Skip to content

Instantly share code, notes, and snippets.

@gunlee01
Created May 23, 2018 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gunlee01/a30a5449fcec9d51bda0c771bc84eb70 to your computer and use it in GitHub Desktop.
Save gunlee01/a30a5449fcec9d51bda0c771bc84eb70 to your computer and use it in GitHub Desktop.
String objType = $counter.getObjType();
String objName = $counter.getObjName();
float avgTpsCurrent = $counter.getLatestAvg(30); //latest 30s avg
float avgTps3minAgo = $counter.getAvg(180+30, 30); //3min ago 30s avg
String title = "TPS fluctuation alert";
String message = "TPS is highly(over 1.5x) incresed in 3min\n";
message += "[TPS current] " + $$.formatNumber(avgTpsCurrent) + "\n";
message += "[TPS 3min ago] " + $$.formatNumber(avgTps3minAgo) + "\n";
message += "[objType] " + objType + "\n";
message += "[objName] " + objName + "\n";
if(avgTpsCurrent > avgTps3minAgo * 1.5) {
$counter.fatal(title, message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment