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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Question on Statistics/Metrics
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Question on Statistics/Metrics
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (19,511 posts)  [Biography] bio   Forum Administrator
Date Fri 16 Jul 2010 01:30 AM (UTC)  quote  ]
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

Posted by Nick Gammon   Australia  (19,511 posts)  [Biography] bio   Forum Administrator
Date Fri 16 Jul 2010 01:09 AM (UTC)  quote  ]
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 Twisol   USA  (2,230 posts)  [Biography] bio
Date Fri 16 Jul 2010 01:05 AM (UTC)  quote  ]

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 WillFa   USA  (517 posts)  [Biography] bio
Date Fri 16 Jul 2010 12:29 AM (UTC)  quote  ]

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

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.


1,473 views.

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [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.

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]