Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Does it always report it a runtime of 0, on reboot? Or something close to zero (less then former time anyway)?</p> <p>You could calculate this two ways. 1. The lower the number, the less troubles it had. 2. The higher the number, it scored the largest periods.</p> <p>I guess you need to account, that the health can vary. So it can worsen over time. So the latest values, should have a higher weight then the older ones. This could indicate a exponential growth.</p> <p>The more reboots it had in the last period, the more broken the system could be. But also looking at shorter intervals of the reboots. Let's say, 5 reboots a day vs. 10 reboots in 2 weeks. That does mean a lot different. So I guess time should be a metric as well as the amount of reboots in this formula.</p> <p>I guess you need to calculate the density of the amount of reboots in the last period.</p> <p>You can use the weight of the density, by simply dividing. Because how larger the number is, on which you divide, how lower the result will be, so how lower the weight of the number can become.</p> <p>Pseudo code:</p> <pre><code>function calcHealth(machine) float value = 0; float threshold = 800; for each (reboot in machine.reboots) { reboot.daysPast = time() - reboot.time; // the more days past, the lower the value, so the lower the weight value += (100 / reboot.daysPast); } return (value == 0) ? 0 : (threshold / value); } </code></pre> <p>You could advance this function by for example, filtering for maxDaysPast and playing with the threshold and stuff like that.</p> <p>This formula is based on this plot: <a href="http://www.wolframalpha.com/input/?i=plot+%28100+%2F+x%29" rel="nofollow noreferrer">f(x) = 100/x</a>. As you see, on low numbers (low x value), the value is higher, then on large x value. So that's on how this formula calculates the weight of the daysPast. Because lower daysPast == lower x == heigher weight.</p> <p>With the value += this formula counts the reboots and with the 100/x part it gives weight to the reboot, on where the weight is the time.</p> <p>At the return, the threshold is divided through the value. This is because, the higher the score of the reboots, the lower the result must be.</p> <p>You can use a plotting program or calculator, to see the bending of the plot, which is also the bending of the weight of the daysPast.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload