Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ General
➜ Question on Statistics/Metrics
Question on Statistics/Metrics
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| WillFa
USA (525 posts) 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? | Top |
|
Posted by
| Twisol
USA (2,257 posts) 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 | Top |
|
Posted by
| Nick Gammon
Australia (23,046 posts) 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 | Top |
|
Posted by
| Nick Gammon
Australia (23,046 posts) 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 | 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,906 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top