{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/Batch/issues/29","repository_url":"https://api.github.com/repos/Azure/Batch","labels_url":"https://api.github.com/repos/Azure/Batch/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/Azure/Batch/issues/29/comments","events_url":"https://api.github.com/repos/Azure/Batch/issues/29/events","html_url":"https://github.com/Azure/Batch/issues/29","id":377776537,"node_id":"MDU6SXNzdWUzNzc3NzY1Mzc=","number":29,"title":"Add counters for active/running tasks","user":{"login":"sylr","id":153052,"node_id":"MDQ6VXNlcjE1MzA1Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/153052?v=4","gravatar_id":"","url":"https://api.github.com/users/sylr","html_url":"https://github.com/sylr","followers_url":"https://api.github.com/users/sylr/followers","following_url":"https://api.github.com/users/sylr/following{/other_user}","gists_url":"https://api.github.com/users/sylr/gists{/gist_id}","starred_url":"https://api.github.com/users/sylr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sylr/subscriptions","organizations_url":"https://api.github.com/users/sylr/orgs","repos_url":"https://api.github.com/users/sylr/repos","events_url":"https://api.github.com/users/sylr/events{/privacy}","received_events_url":"https://api.github.com/users/sylr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-11-06T10:13:05Z","updated_at":"2018-12-03T20:49:35Z","closed_at":null,"author_association":"NONE","body":"#### Feature Request Description\r\nWe want to be able to have precise batch metrics, especially task volume metrics.\r\n\r\n#### Describe Preferred Solution\r\nAt this time the active & running task metrics are gauge metrics describing the amount of active/running tasks at a given time. Although useful it would be great to have also total counters for active & running tasks to be able to compute volumes (delta).\r\n\r\nCurrent\r\n```go\r\n// TaskCounts ...\r\ntype TaskCounts struct {\r\n    autorest.Response `json:\"-\"`\r\n    Active            *int32 `json:\"active,omitempty\"`\r\n    Running           *int32 `json:\"running,omitempty\"`\r\n    Completed         *int32 `json:\"completed,omitempty\"`\r\n    Succeeded         *int32 `json:\"succeeded,omitempty\"`\r\n    Failed            *int32 `json:\"failed,omitempty\"`\r\n}\r\n```\r\nProposed\r\n```go\r\n// TaskCounts ...\r\ntype TaskCounts struct {\r\n    autorest.Response `json:\"-\"`\r\n    Active            *int32 `json:\"active,omitempty\"`\r\n    ActiveTotal       *int32 `json:\"active_total,omitempty\"`\r\n    Running           *int32 `json:\"running,omitempty\"`\r\n    RunningTotal      *int32 `json:\"running_total,omitempty\"`\r\n    CompletedTotal    *int32 `json:\"completed_total,omitempty\"`\r\n    SucceededTotal    *int32 `json:\"succeeded_total,omitempty\"`\r\n    FailedTotal       *int32 `json:\"failed_total,omitempty\"`\r\n}\r\n```\r\n\r\n#### Additional Context\r\nI asked this because after writing [prometheus-azure-exporter](https://github.com/sylr/prometheus-azure-exporter) (which was initially written only to expose Azure Batch metrics to prometheus) we couldn't represent accurately active & running tasks because gauges do not show what happens between two metrics retrievals."},"comment":{"url":"https://api.github.com/repos/Azure/Batch/issues/comments/443864900","html_url":"https://github.com/Azure/Batch/issues/29#issuecomment-443864900","issue_url":"https://api.github.com/repos/Azure/Batch/issues/29","id":443864900,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Mzg2NDkwMA==","user":{"login":"matthchr","id":8798850,"node_id":"MDQ6VXNlcjg3OTg4NTA=","avatar_url":"https://avatars1.githubusercontent.com/u/8798850?v=4","gravatar_id":"","url":"https://api.github.com/users/matthchr","html_url":"https://github.com/matthchr","followers_url":"https://api.github.com/users/matthchr/followers","following_url":"https://api.github.com/users/matthchr/following{/other_user}","gists_url":"https://api.github.com/users/matthchr/gists{/gist_id}","starred_url":"https://api.github.com/users/matthchr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthchr/subscriptions","organizations_url":"https://api.github.com/users/matthchr/orgs","repos_url":"https://api.github.com/users/matthchr/repos","events_url":"https://api.github.com/users/matthchr/events{/privacy}","received_events_url":"https://api.github.com/users/matthchr/received_events","type":"User","site_admin":false},"created_at":"2018-12-03T20:49:35Z","updated_at":"2018-12-03T20:49:35Z","author_association":"CONTRIBUTOR","body":"Hi @sylr - just making sure we understand this correctly.\r\n\r\nCurrently, `Active`, `Completed`, etc are snapshots of the current number of tasks in the given state at the time you call the metrics API. It already includes _all tasks_ (so, `Active` + `Completed` + `Running` = total of all tasks).\r\n\r\nWhat's the proposed difference between that behavior, and your `Total` proposal?\r\nIs the primary desire you have to track tasks which have been deleted?\r\n\r\nSo for example if at `t0` you have:\r\n```\r\n20 active\r\n10 running\r\n10 completed\r\n```\r\n\r\nand then you delete the 20 active tasks, you'd like to see:\r\n```\r\n0 active\r\n10 running\r\n10 completed\r\n20 TotalActive\r\n```\r\n\r\nIs that right?"}}
{"actor":{"display_login":"matthchr"}}