[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Question on Statistics/Metrics

Question on Statistics/Metrics

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Fri 16 Jul 2010 12:29 AM (UTC)

Amended on Fri 16 Jul 2010 12:30 AM (UTC) by WillFa

Message
Nick,

Do the stats displayed in the lower right corner of the trigger edit windows reflect the time it took the RegEx engine to match the pattern, or the time to match and execute the script and finalize the trig?



Oh, and is there a way to get similar stats about a plugin?
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #1 on Fri 16 Jul 2010 01:05 AM (UTC)

Amended on Fri 16 Jul 2010 01:11 AM (UTC) by Twisol

Message
WillFa said:
Nick,

Not Nick, but I do have a copy of the source in front of me. >_>

WillFa said:
Do the stats displayed in the lower right corner of the trigger edit windows reflect the time it took the RegEx engine to match the pattern, or the time to match and execute the script and finalize the trig?

Looks like it's the time it took to match the pattern. Here's how it looks in my fork. I heavily refactored the regular expression class, but it should work the same, and I barely touched the code in this particular section anyways. At any rate:

  LARGE_INTEGER start;
  if (App.m_iCounterFrequency)
    QueryPerformanceCounter (&start);

  int options = App.m_bRegexpMatchEmpty ? 0 : PCRE_NOTEMPTY; // don't match on an empty string
  pcre_callout = NULL; // un-set the global pcre_callout() function pointer
  int count = pcre_exec(
      this->m_program, this->m_extra,
      string, strlen (string), start_offset,
      options, &offsets[0], offsets.size()
      );

  if (App.m_iCounterFrequency)
    {
    LARGE_INTEGER finish;
    QueryPerformanceCounter (&finish);
    this->iTimeTaken += finish.QuadPart - start.QuadPart;
    }


WillFa said:
Oh, and is there a way to get similar stats about a plugin?

I believe it's exposed through GetTriggerInfo. There's also a GetPluginTriggerInfo for externally getting at it. Selector 20 for the script invocation count, and 21 for times matched. I can't find a total-time-taken selector, oddly.

EDIT: Yeah, not seeing the time taken accessed anywhere visible from a script, so chances are good that it's not accessible currently.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Fri 16 Jul 2010 01:09 AM (UTC)
Message
The stats shown on the trigger edit window are the time taken for the regular expression to match (or not). It excludes the time taken to do something if it matches.

There is no present way of finding the time taken in plugins, however I have just added new selectors to GetTriggerInfo and GetAliasInfo (release 4.53) which lets you query that (and GetPluginTriggerInfo and GetPluginAliasInfo).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Fri 16 Jul 2010 01:30 AM (UTC)
Message
I also note it doesn't tell you how many times it attempts to match, so I added a couple more selectors to do that. So now you could find the average time-to-match by dividing one by the other.

For lines from the MUD, an *attempt* to match will be made for every line, unless a preceding trigger in the trigger sequence already matched, and did not have "keep evaluating" set.

This could be useful to see whether your triggers or aliases are slowing down execution significantly.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,126 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]