Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Recommended Posts

Posted (edited)

Good morning,

is there a millisecond-resolution wall clock available in HC3 QuickApps?

As I want to measure between-quickapp communication latency, the os.clock() is not a solution - I checked and it measures just CPU time.

Or - is there a method to measure a single quickapp millisecond run time, not only CPU time of the application?

Edited by Łukasz997
Posted (edited)

Make a 100 or 1000 request with os.time and calculate the average round trip...

 

Edited by jgab
Posted

Yep, this is only solution.

Lua does not support natively ms.

  • Topic Author
  • Posted

    Thank you very much. In my particular case this will not help - measurig points incomes "at it's will", instead of one-after-one stream.

    I heard about socket.gettime but not here...

     

    Basically, the need for this arose because, for a new idea of mine, I wanted to check how reliable a hub.call to another QuickApp actually is. 

     

    By the way, I am attaching these two little programs, the sender and the receiver. This may be an interesting experiment for some of you, showing just how much is happening inside that black box.

    Before start, you need to enter the correct IDs of both programs in the sender (SENDER and RECEIVER constants), so that it can filter out the communication between them. 

    The sender sends a call to the receiver together with its own counter value. The receiver receives it, but also maintains its own counter, which must match the value it received. In addition, the average number of events per hour is calculated over a twelve-hour rolling window. Once the window has been filled, the minimum and maximum events-per-hour values will also be updated.

    Number of missing hub.calls will also be shown.

     

    I also wanted to measure the sender-receiver-sender round-trip time “in real life”, but unfortunately, that cannot be done...

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...