Announcement

Collapse
No announcement yet.

Event Execution Delay Measurement Script discussion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wadenut
    replied
    Originally posted by jon00 View Post
    Apologies but have little free time left today. Just to say that I have modified my Virtual Graphing utility to show optional session average. I have also added a graph reset and added a (quirky) method to push data directly and display an entire graph.

    I just need to do some testing and write up the docs. Hopefully it will be ready later this week.
    Much appreciated.

    Leave a comment:


  • jon00
    replied
    Apologies but have little free time left today. Just to say that I have modified my Virtual Graphing utility to show optional session average. I have also added a graph reset and added a (quirky) method to push data directly and display an entire graph.

    I just need to do some testing and write up the docs. Hopefully it will be ready later this week.

    Leave a comment:


  • Wadenut
    replied
    This originally began life as a simple five line script for my own use, intended as a tool to determine the cause of delayed events I was experiencing. It's obviously grown way beyond those proportions, and evidently the problem is much more widespread than I'd suspected. I'm very much gratified that so many find it so useful.

    Thanks Jon. I like it. I'll incorporate your suggestion and make it an option (either-or-both) for the sake of those who may not be using your graphs (as if anyone wouldn't).
    The suggestion also gives us all insight how we can further customize other graphs on the fly.

    I've actually been working on some other improvements as well.
    1. Delayed actions: to avoid warnings or reboots based on one sample being over the defined limits. This is configurable to any number of consecutive samples. I've been thinking of an increment/decrement scheme as well.
    2. Min/Max within the device string, with the option of performing a reset on the device at any point via an event to erase the min/max values. This might of course be obviated if one directly writes to the graph exclusively.
    3. I'm wondering now if the configuration section might be better off read from a configuration file. [Thoughts?]

    I currently run this once per minute and graph every five minutes to enable viewing a 24 hour snapshot. Naturally, this means I see only one in five samples. This was what I had in mind when I requested averaging in Jon00VDGraphing a coulple of weeks ago.

    To further cross over... Based on some of the comments I've received about the wide range of delays people are seeing (one large delay can obfuscate an entire graph), I wonder if a logarithmic scale on the graphs might be something you'd be able to consider as an optional parameter as well.

    Leave a comment:


  • Pete
    replied
    Deleted the old graph and started it again. So then just get rid of the Y99 virtual variable since its already showing in the Y90 graph text and its more timely eh?

    What about the on/off feature that was added? If I delete Y99 then I will not have this.
    Attached Files

    Leave a comment:


  • Pete
    replied
    Jon,

    Then

    Dim TrackDV As String = "Y99"
    in the original script would be the same as the variable in the INI?

    [Graph20]
    Housecode=w77
    or I would just keep it at the two variables as before? One for Gregs script and one for the graph.

    and I would still run both the Event delay script and the graphing script in one event eh?

    I think too that my divide value was set to 1000 and when I set it to 1 just now its giving me thousands of seconds in the graph display.

    Nah, now I am thinking that below is 18K ms which is right.
    Attached Files

    Leave a comment:


  • jon00
    replied
    Thanks for writing this useful script Greg.

    When using my virtual graphing utility, rather than displaying the current value/delta in a separate virtual device, I have just incorporated this within the graph text. Here's how to do it:

    In the Event Delay Check.vb script, find the following 2 lines:

    PHP Code:
    hs.SetDeviceString(TrackDV,"<font color=" DVColor ">" DVString "</font>")
    hs.SetDeviceValue(TrackDV,CInt(DelayTime 1000)) 
    You can optionally place remarks in front of each line i.e.

    PHP Code:
    'hs.SetDeviceString(TrackDV,"<font color=" & DVColor & ">" & DVString & "</font>")
    '
    hs.SetDeviceValue(TrackDV,CInt(DelayTime 1000)) 
    If you do this, then you can delete the existing current value/delta virtual device. Now add the following code beneath these 2 lines i.e.

    PHP Code:
    'hs.SetDeviceString(TrackDV,"<font color=" & DVColor & ">" & DVString & "</font>")
    '
    hs.SetDeviceValue(TrackDV,CInt(DelayTime 1000))
    Dim GraphNumber As String "20"
    hs.SaveINISetting("Graph" GraphNumber,"TextAfterValue","&nbsp;- " DVString,"Jon00VDGraphing.ini")
    hs.SaveINISetting("Graph" GraphNumber,"Data",CInt(DelayTime 1000),"Jon00VDGraphing.ini")
    hs.RunEx("Jon00VDGraphing.vben","Main",GraphNumber
    If necessary, change the GraphNumber=20 to whatever graph number you have used or wish to use.

    Remove any previous events to update my graphing utility for the event delay check data.

    This is my settings from Jon00VDGraphing.ini for [Graph20]:

    PHP Code:
    [Graph20]
    Housecode=w77
    Title
    =Event Execution Delay
    TextBeforeValue

    TextAfterValue=
    Units milliseconds
    BackGroundColor
    ="#5E697A"
    ImageFile=blue.gif
    Range1Upper
    =999
    Range1Lower
    =0
    Range1ImageFile
    =Green.gif
    Range2Upper
    =4999
    Range2Lower
    =1000
    Range2ImageFile
    =Yellow.gif
    Range3Upper
    =999999
    Range3Lower
    =5000
    Range3ImageFile
    =Red.gif
    SampleSize
    =300
    Height
    =30
    HeightSpacer
    =4
    ToolTips
    =1
    Offset
    =0
    ShowCurrentValue
    =1
    ShowLowHighValues
    =2
    DelayCount
    =1
    DivideValue
    =1
    Markerheight
    =5
    MarkerDuration
    =0
    MarkerImageFile
    =white.gif
    MarkerType
    =1
    data
    =
    CurrentValue=
    HighValue=
    LowValue
    The result is shown below. Like the existing virtual device showing the current value and delta, the device value of the Graphs virtual device also contains the current value.

    The graph is immediately updated each time Event Delay Check.vb runs.
    Attached Files

    Leave a comment:


  • fungun
    replied
    Ah, gotchya, just take the colors out on the ends.

    Thanks,
    Tim

    Leave a comment:


  • Wadenut
    replied
    hs.WritelogEx("Error","System UpTime: " & hs.SystemUptime,"#FF0000")
    would become
    hs.Writelog("Error","System UpTime: " & hs.SystemUptime)

    etc.

    Leave a comment:


  • fungun
    replied
    Code:
    If LogResult Then hs.Writelog("Event Delay","Currently " & DVString & " Scripts running: " & hs.ScriptsRunning,DVColor)
        hs.SetDeviceString(TrackDV,"<font color=" & DVColor & ">" & DVString & "</font>")
        hs.SetDeviceValue(TrackDV,DelayTime * 1000)
        If LogWarning <> 0 And DelayTime >= LogWarning Then
            hs.Writelog("Warning","Events seem to be delayed. Current delay is " & DelayTime & " seconds." & "Scripts running: " & hs.ScriptsRunning,"#D58000")
        End If
        If SpeakWarning <> 0 And DelayTime >= SpeakWarning Then hs.Speak(SpeakMessage)
        If Reboot <> 0 And DelayTime >= Reboot Then
            hs.Writelog("Error","System UpTime: " & hs.SystemUptime,"#FF0000")
            hs.Writelog("Error","System is restarting due to Event Execution Delay","#FF0000")
            hs.RestartSystem
        End If 
    End Sub
    Ok, which part should I take out?
    Not real good with this vb stuff yet.

    Thanks,
    Tim

    Leave a comment:


  • fungun
    replied
    HS ver 2.3.0.19.
    Ok, I will try that.

    Thanks,
    Tim

    Leave a comment:


  • Wadenut
    replied
    What version of HS are you using? writelogex was added some time ago.
    You could, if it's an early version, remove the third argument from each of the writelog's.... or just upgrade HS.

    Leave a comment:


  • fungun
    replied
    I loaded the 1.04 version and now I get an error-
    8/20/2012 5:30:04 PM ~!~Error~!~Script compile error: 'WritelogEx' is not a member of 'Scheduler.hsapplication'.on line 38
    So I went and took out all the "Ex" pieces after the "WritelogEx" and now I get this error-
    8/20/2012 5:54:00 PM ~!~Error~!~Script compile error: Too many arguments to 'Public Sub WriteLog(mtype As String, message As String)'.on line 38
    So now I am alittle confused what to do next.

    Thanks,
    Tim

    Leave a comment:


  • Mario23
    replied
    Originally posted by rmasonjr View Post
    Pretty interesting. My highest delta occurred during a ZWave poll, which failed:
    That is interesting. That's a polling error I see every day. I wonder if anything could be learned from this...

    Leave a comment:


  • Pete
    replied
    I'm testing on two flavors of CPU. One is a Atom D525 and the other one is a core duo (8800?). That said the 4 psuedocores on the D525 seem to distribute the processing better but the core duo seems a bit faster; the end result though seems to balance out the multitasking. Built (documented below) hot swap cage boxes and now have a few small SATA drives with different OS builds / flavors for each box; fast to switch.

    On the HSTouch client side was/is currently using Atom based CPUs and they do fine. Even better though are the Aopen Digital Engines (core duo's) with HDMI out for HD HSTouch screens; very quick at HD resolutions.

    Then again the 800Mhz MS CE6.0 touchscreen works well comparing it to the 800Mhz Chumby running Linux/RDP to a terminal server running HSTouch remotely.

    I do though use a higher horsepower CPU these days for my MM headless server running TVersity/PlayON TV for HD streaming or for my Zoneminder box with an old PCI 8 analog card plus SD/HD IP cams on it; works fine.

    Historically though did benchmark applications running virtually optimizing CPU / memory etc for best throughput a few years back. I initially did have issues with USB to hardware (security stuff) connectivity; then went to USB to IP to Virtual boxes and it worked 1-2 devices at a time. Back then though never went higher than the one or two devices. A couple of years ago though did test HS running connecting to devices via a virtual IP USB port to the Digi Edgeports (16 serial devices) and the only real issues were related to sound drivers and the W2C box; but I was using USB 1.X. That issue was solved used a Lantronics USB 2.0 to IP device though.

    All the above said; I am not a "server hugger" and promoted the optimizing/collapse of "server" farms to the virtual worlds a few years go after exhaustive views at functionalities provided by a "small" enterprise server farm of around 250 physical boxes.
    Last edited by Pete; August 20, 2012, 08:36 AM.

    Leave a comment:


  • Automated
    replied
    I think I will load this just to compare my delays on a fairly strong vSphere virtualized Homeseer install, with those of you who are running Atom installs. I do not notice any significant delays ever except rare occasions, so it will be an interesting exercise.

    Leave a comment:

Working...
X