Changes

Jump to: navigation, search

Mozilla Metrics Server Collection

5,693 bytes added, 18:18, 25 November 2007
no edit summary
== Project Details ==
'''==PROJECT SPECIFICATIONS FOR VERSION 0.1'''==
This project will require me to do the following:
'''==OVERVIEW'''==
On initialization of the metrics extension, the extension pings the server for a config file; which is in the form of an xml.
'''==SAMPLE DATA'''==
[http://matrix.senecac.on.ca/~sljung/metrics/sampleconfig.xml Config file sample]
'''==Project COMPLICATIONS & SOLUTIONS'''==
*There seems to be a link problem when trying to compile the extension in windows xp. Reading the source code, and with the help of luser, I was able to figure out some problems within the code. Minor changes were made to make files in both the "/extension/metrics/build" and "/extensions/metrics/test" folders; Added "USE_STATIC_LIBS=1" so that the compiler knows to use the static library. Will create a patch and post on bugzilla once I'm done.
*Echoing a file back to the extension was pretty straightforward; however, recieving receiving the proper data back was more difficult. Initially, I assumed the data being sent back was an xml file but after reading the source code in-depth, I found that the data was actually compressed with BZIP2 (x.bz2). Changes were made to the CGI to bunzip2 the data.
*Another problem, similar to problem 2, was that my while loop to read stdin was not recieving receiving all the data properly. With the help of "ctyler" I was able to recieve receive the data in-tact. ==PROJECT SPECIFICATIONS FOR VERSION 0.2== *Set-up MySql Server and Django*Use Django to create a database infrastructure ==OVERVIEW==The basis of my 0.2 release, was to create a database infrastructure for the xml data being sent to the server from the Metrics extension. Once this is done, my 0.3 Release would require me to create a script that will receive the data and use the Djangomodels already created to parse the data into each table. Currently, the database infrastructure is done for all the elementsI am aware the Metrics extension can send. There have been a few complications trying to figure out what the proper config elementis to activate the other modules; however, right now I am able to get data regarding - profile, plugins, extensions, uielements,and bookmarks.  ==SAMPLE DATA==*[http://octopuppy.dreamhosters.com/metrics/datasample.JPG Sample Data on Admin]*[http://octopuppy.dreamhosters.com/metrics/dbsync.JPG Databases Created]*[http://octopuppy.dreamhosters.com/metrics/mserver.zip Full Source & Build === Metrics Models.py === from django.db import models  class User(models.Model): clientid = models.CharField(primary_key=True, max_length=22) def __unicode__(self): return self.clientid class Admin: pass  class Bookmark(models.Model): name = models.CharField(max_length=20) def __unicode__(self): return self.name class Admin: pass  class CpuArch(models.Model): cpu_arch = models.CharField(max_length=20) def __unicode__(self): return self.cpu_arch class Admin: pass  class UIElement(models.Model): targetid = models.CharField(max_length=24) action = models.CharField(max_length=40) def __unicode__(self): return self.targetid class Admin: pass  class Install(models.Model): date = models.IntegerField() default = models.BooleanField() buildid = models.IntegerField() class Admin: pass  class Extension(models.Model): id = models.CharField(primary_key=True, max_length=22) version = models.CharField(max_length=20) def __unicode__(self): return self.id class Admin: pass  class Plugin(models.Model): filename = models.CharField(max_length=24) name = models.CharField(max_length=22) def __unicode__(self): return self.name class Admin: pass  class Display(models.Model): ysize = models.IntegerField() xsize = models.IntegerField() screens = models.IntegerField() class Admin: pass  class BookmarkCount(models.Model): foldercount = models.IntegerField() itemcount = models.IntegerField() seperatorcount = models.IntegerField() livemarkcount = models.IntegerField() bookmark = models.ForeignKey(Bookmark) class Admin: pass  class Session(models.Model): session_number = models.IntegerField() time = models.IntegerField() class Admin: pass  class UIUsage(models.Model): time = models.IntegerField() window = models.IntegerField() ui_element = models.ForeignKey(UIElement) session = models.ForeignKey(Session) def __unicode__(self): return self.ui_element class Admin: pass  class Profile(models.Model): session = models.ForeignKey(Session) cpu_arch = models.ForeignKey(CpuArch) memory_mb = models.IntegerField() display = models.ForeignKey(Display) install = models.ForeignKey(Install) extension = models.ManyToManyField(Extension) plugin = models.ManyToManyField(Plugin) bookmarkcount = models.ForeignKey(BookmarkCount) class Admin: pass  class Log(models.Model): user = models.ForeignKey(User) version = models.IntegerField() profile = models.ForeignKey(Profile) class Admin: pass ==Project COMPLICATIONS & SOLUTIONS==**[http://code.djangoproject.com/ticket/24 Bug Ticket 24] This bug doesn't allow any objects that have One to One Relationships to be shown in the admin; there are no solutions because its resolved with WON'T FIX. Only way around it was to use Foreign Keys and restrict it in admin mode.**[http://http://code.djangoproject.com/ticket/1939 Bug Ticket 1939] Once again, another Won't fix bug that won't allow me to use proper Multiple Foreign Keys.**There was a problem setting up Django which was not copying all the proper files needed to build a project. The only solution that worked for me was to copy all the contents from the ''trunk/django'' to ''Python25\Lib\site-packages''.**Although I can't find the exact bug right now, Django has some complications using Many to Many relationships too. Once again, I resolved it by using Foreign Keys. However, these solutions can only be temporary.
== Project News ==
*Created a patch for the metrics extension.
*Going to submit a patch to bugzilla after I get somone to compile it in linux
 
Monday, November 19th 2007
*Finally finshed all the tutorials, installations, set-ups, fixes
 
Tuesday, November 20th 2007
*Made a basic database schema based off the xml I received from the client
 
Thursday, November 22nd 2007
*Tried to Code the database schema; however, I ran into a lot of problems
*Asked a few questions about problems with relationships on [irc://irc.freenode.net/django irc.freenode.net #django] and were lead to certain tickets on bugs and documentation.
 
Friday, November 23rd 2007
*Setup another project
*Created new schema
 
Sunday, November 25th 2007
*Got some advice in seneca irc channel and ctyler and came up with a much better database structure with somewhat proper relationships (becuz of bugs)
*build the models and server project
== Resources ==
1
edit

Navigation menu