Closed (fixed)
Project:
Drush
Component:
Base system (internal API)
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2011 at 19:56 UTC
Updated:
30 Jan 2012 at 21:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
moshe weitzman commentedAttached commandfile logs locally. Rename to usage.drush.inc and put in ~/.drush
I've asked MongoLab if they support multi-insert via the REST interface. Kinda critical for speedy data transfer.
Comment #2
moshe weitzman commentedMongoLab does not support multi-insert via REST. Google spreadsheets has a max row limit. Starting to think we'll need to use a Drupal backend.
Comment #3
moshe weitzman commentedIf you are using the commandfile attached earlier to track your usage, then you will see an error if it loads and you happen to use drush4 (it was written for drush5). To avoid that error, name the attached file usage.drush.load.inc and put it in ~/.drush alongside the commandfile. This prevents the commandfile from loading on 4. Interested parties can see where we do this check at http://api.drush.org/api/function/_drush_add_commandfiles/5.x
Comment #4
moshe weitzman commentedMongolab added multi-insert to its REST API so here is a new usage.drush5.inc. As the name implies, it only works for drush5 and you have to have today's version, or later. Also, paste the following code into your drushrc.php to turn it on completely:
Comment #5
moshe weitzman commentedSlightly better version that breaks out major and minor version of drush.
So, do people think this should ship with drush5? Would be off by default.
Comment #6
moshe weitzman commentedSo - put this into drush5 or no?
Comment #7
greg.1.anderson commentedLooks good to me; I'd be in favor of putting it in.
You could now use
drush_directory_cache('usage') . '/usage.txt';instead ofdrush_directory_cache() . '/usage/usage.txt';, if you want. It would create the usage dir for you, then.Seems like the 10k limit is too low;
drush status --debugsends usage info every time. Maybe 50k or 100k would be better? Don't want to go too high...A frill: include a command to show the unsent cached data. Folks might want to run it for a while and inspect before enabling the send feature.
Comment #8
greg.1.anderson commentedIt looks like the usage stats were being sent every time because the comparison operator was reversed. The stat files are tiny.
Here is a slightly reworked version with two frill commands: usage-show and usage-send. Perhaps these should be hidden commands to avoid clutter?
Comment #9
moshe weitzman commentedCommitted to master.
I upped default log_size to 50Kb, added README/drushrc.php docs, removed confirm for usage-send, and added a 'host' element so we can omit outlier submitters when running reports.
Comment #10
moshe weitzman commentedAdded notice at http://drupal.org/node/1407148