Skip to content

Commit

Permalink
sc3#455 - added displaying of stats
Browse files Browse the repository at this point in the history
  • Loading branch information
nwinklareth committed Nov 30, 2014
1 parent da93da4 commit 8fcfe40
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ include
lib
.Python
.idea
*~
11 changes: 11 additions & 0 deletions countyapi/management/commands/iloaddata.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,23 @@ def handle(self, *args, **options):

self.__populate_database(FIRST_PASS_MODELS)
self.__populate_database(SECOND_PASS_MODELS)

self.__display_stats()

print 'Incremental loading took %f seconds.' % (time.clock() - beginning)

def __activate_json_parser(self):
self.__jsonParser = ijson.parse(open(self.__jsonFileName, 'r'))
self.__jsonParser.next() # skip over the start of the list

def __display_stats(self):
print "Num Charges History processed: %d" % self.__num_charges_history
print "Num County Inmates processed: %d" % self.__num_county_inmates
print "Num Court Dates processed: %d" % self.__num_court_dates
print "Num Court Locations processed: %d" % self.__num_court_location
print "Num Housing Locations processed: %d" % self.__num_housing_location
print "Num Housing History processed: %d" % self.__num_housing_history

def __fetch_db_entry(self, models_to_populate):
db_entry = None
while db_entry is None:
Expand Down

0 comments on commit 8fcfe40

Please sign in to comment.