Hi Thomas,

> 
> Is this what you are thinking off with regards to adding it to the 
> TaskController?
> 
> TaskControllerImpl.java:
> ...
> public void addTasks(Task tasks[], TaskPriority priority) {
>       // Track module usage
>       String taskClass = tasks[0].getClass().getName();
>       taskClass = taskClass.substring(taskClass.lastIndexOf(".") + 1);
>       GoogleAnalyticsTracker GAT = new GoogleAnalyticsTracker(taskClass, 
> "/JAVA/"+taskClass);
>       Thread gatThread = new Thread(GAT);
>       gatThread.setPriority(Thread.MIN_PRIORITY);
>       gatThread.start();
>       
>       ...
> }
> ...
> 

Yes, I think this is good. 
Instead of adding the tracking to addTasks(), you may consider adding it to 
WorkerThread, after the task execution is finished. 
That way we could also track the TaskStatus when the task finished (potentially 
useful information).
But if you don't like this idea, feel free to ignore.


> We could also do something like this to make the text more informative but 
> that requires adding information about all modules to the taskcontroller:
> String gatTaskTitle = null, gatTaskPath = null;
> switch(taskClass) {
>       case "MzMLReadTask": gatTaskTitle = "mzML Read"; gatTaskPath = 
> "/JAVA/RAW/Import/mzML";
>       case "MassDetectionTask": gatTaskTitle = "Mass Detection"; gatTaskPath 
> = "/JAVA/RAW/MassDetection";
>       ...
> }

I think any kind of enumeration of task types would just add another burden for 
code maintenance..

Cheers,

Tomas

===============================================
Tomas Pluskal
G0 Cell Unit, Okinawa Institute of Science and Technology Graduate University
1919-1 Tancha, Onna-son, Okinawa 904-0495, Japan
WWW: https://groups.oist.jp/g0
TEL: +81-98-966-8684
Fax: +81-98-966-2890


------------------------------------------------------------------------------
_______________________________________________
Mzmine-devel mailing list
Mzmine-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mzmine-devel

Reply via email to