Forcing a report update

Extensions and customization
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Warlax
Posts:18
Joined:19 May 2010 20:45
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Forcing a report update

Post by Warlax » 17 Sep 2010 20:51

Hi,

If I run my statistic mode than once, the report doesn't change.

I noticed that every statistics object's getReport( ) method is only invoked from the StatisticsModelImpl class.
However, the StatisticsModelImpl object keeps a map of one report per Statistics class -- so the second time around, getReport( ) is not called and the user is displayed an old report.

Is there a way for me to force the StatisticsModelImpl to call getReport( ) on my statistics object no matter what that does not involve changing the StatisticsModelImpl code? I am writing my custom plugin for Gephi but am assuming that the user has "stock" Gephi.

Thanks.

User avatar
mbastian
Gephi Architect
Posts:728
Joined:10 Dec 2009 10:11
Location:San Francisco, CA
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Forcing a report update

Post by mbastian » 02 Oct 2010 12:43

Is there a way for me to force the StatisticsModelImpl to call getReport( ) on my statistics object no matter what that does not involve changing the StatisticsModelImpl code? I am writing my custom plugin for Gephi but am assuming that the user has "stock" Gephi.
No this is not possible with the current API I think.

The primary reason why we cache reports now is to avoid Statistics to have to keep all their data, which are necessary to generate reports. By storing only reports, Statistics can be GC and free a lot of memory.

The current API lacks an abstraction about Reports. They are now only pure String objects, which I think is not enough. If Statistics would return a "Report" object instead of a String, it would be possible for you to implement your own Report class and override the way to return reports.

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable