Tags:
create new tag
view all tags

SID-01230: Plugin Statistics

Status: Answered Answered TWiki version: 5.0.2 Perl version: v5.10.1 (*) built for x86_64-linux-thread-multi
Category: CategoryPlugins Server OS: SLC6, kernel version 2.6.32-131.4.1.el6.x86_64 Last update: 14 years ago

I'm attempting to find out the best way to log statistics of use of each plugin installed and enabled on my local TWiki installation.

It seems that there are no plugin logs except where a plugin has failed. The other problem is that every plugin is "used" every time a page is viewed, and each plugin returns 1 upon completion, so this data isn't especially helpful.

I've been attempting to build perl scripts to parse through the plugin files to generate a list of plugin markups, and then parse all the topics (in all webs) looking for this markup, and logging when it is found.

Unfortunately, there seems to be no consistency between plugins... Different plugins have different rules for markup, i.e. not all plugins look for markup of the form %NAME{PARAMS}%, for example, the TablePlugin, or SmiliesPlugin.

Short of writing a perl script to go through all the plugin source code inserting extra lines of Perl, I'm at a loss of what to do.

Perhaps some of you more knowledgable of TWiki's plugin infrastructure have some more feasible ideas?

Many thanks in advance, Owen.

-- OwenDyckhoff - 2011-07-11

Discussion and Answer

If I understand correctly you'd like to find out in what pages each plugin is used. As you discovered that is not that easy. Here are some hints:

  • Many plugins use the TWiki::Func::registerTagHandler() to register its variable(s) at plugin init time. For example, the SetGetPlugin registers the variables %GET and %SET.
  • Some plugins use the commonTagsHandler plugin callback to handle variables. For example, the SpreadSheetPlugin uses that to handle %CALC.
  • Some plugins do not handle variables and introduce special syntax. For example, the SmiliesPlugin renders smilies such as :-) as smile using commonTagsHandler callback.
  • Some plugins do not introduce rendering syntax, but do other action. For example, the EditSyntaxPlugin changes the edit syntax on the fly when editing pages. That is, plugins can use various callbacks to interact with TWiki.

I am not sure what the best approach is to get plugin usage statistics. A pragmatic approach is to manually maintain a table of plugins introducing syntax (or try to discover that from plugins), then scan all pages for the syntax. Example table:

Plugin Syntax
SetGetPlugin %GET, %SET
SpreadSheetPlugin %CALC
SmiliesPlugin :-), :-(, etc...

We'd love to get you involved with our community. If you write a plugin please consider contributing it back to the community.

-- PeterThoeny - 2011-07-11

Thank you Peter for your response.

Ideally, I would love to be able to automate the process of "looping" through each installed and enabled plugin, and building up the table of syntaxes based on the contents of the topic pages etc.

However, that process would require very careful planning and developing, in order to accommodate any new syntax that may be introduced by another plugin, so until I have a brainwave, it seems I will have to bite the bullet and maintain the list manually for now.

Until I come across any major hitches, it seems that no further information will be required, so I may as well mark this question as answered.

Thank you again for your valuable input, and I look forward to developing a solution that is worthy of the TWiki community smile

-- OwenDyckhoff - 2011-07-12

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title Plugin Statistics
SupportCategory CategoryPlugins
TWiki version 5.0.2
Server OS SLC6, kernel version 2.6.32-131.4.1.el6.x86_64
Web server Apache/2.2.15 (Unix)
Perl version v5.10.1 (*) built for x86_64-linux-thread-multi
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2011-07-12 - OwenDyckhoff
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.