Skip to content

Add files via upload#4

Open
ravisantoshgudimetla wants to merge 3 commits intomasterfrom
SLA-Algo
Open

Add files via upload#4
ravisantoshgudimetla wants to merge 3 commits intomasterfrom
SLA-Algo

Conversation

@ravisantoshgudimetla
Copy link

Creating a PR to make sure review is easier.

}

func main() {
var user_input = map[int]string{ // Input from the user for each of the SLI

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is your assumption SLI=metric?

var aggregated_node_load float64 = 7 // The aggregated value from prometheus for node load
var aggregated_response_time float64 = 7 // The aggregated value from prometheus for response time

if total_time != new_uptime && len(list_of_uptimes) == 0 && uptime_state == true { // When downtime happens for the first time

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean when we don't have data when we just started with algorithm?

if total_time != new_uptime && len(list_of_uptimes) == 0 && uptime_state == true { // When downtime happens for the first time
uptime_state = false
list_of_uptimes = append(list_of_uptimes, new_uptime)
} else if list_of_uptimes[n] != new_uptime { // When the uptime begins after a downtime and storing the value of Delta

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, this algorithm could be simplified, with a simple function - getStatusOfApp(AppName)

  • Get the current status of app, if it's down, note the time we checked and do a delta between when the app changed status and when we checked last time, if it's down, we already broke the SLA(unless we're checking for part of apps). With this you don't have to maintain, another slice of uptime and downtime_delta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants