{"action":"created","issue":{"url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/issues/182","labels_url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/issues/182/labels{/name}","comments_url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/issues/182/comments","events_url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/issues/182/events","html_url":"https://github.com/cloudfoundry-incubator/cf-abacus/issues/182","id":119608004,"number":182,"title":"Incorrect usage reported for the previous month.","user":{"login":"piotrprzybylski","id":4493924,"avatar_url":"https://avatars.githubusercontent.com/u/4493924?v=3","gravatar_id":"","url":"https://api.github.com/users/piotrprzybylski","html_url":"https://github.com/piotrprzybylski","followers_url":"https://api.github.com/users/piotrprzybylski/followers","following_url":"https://api.github.com/users/piotrprzybylski/following{/other_user}","gists_url":"https://api.github.com/users/piotrprzybylski/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrprzybylski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrprzybylski/subscriptions","organizations_url":"https://api.github.com/users/piotrprzybylski/orgs","repos_url":"https://api.github.com/users/piotrprzybylski/repos","events_url":"https://api.github.com/users/piotrprzybylski/events{/privacy}","received_events_url":"https://api.github.com/users/piotrprzybylski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"BetaFood","id":10606422,"avatar_url":"https://avatars.githubusercontent.com/u/10606422?v=3","gravatar_id":"","url":"https://api.github.com/users/BetaFood","html_url":"https://github.com/BetaFood","followers_url":"https://api.github.com/users/BetaFood/followers","following_url":"https://api.github.com/users/BetaFood/following{/other_user}","gists_url":"https://api.github.com/users/BetaFood/gists{/gist_id}","starred_url":"https://api.github.com/users/BetaFood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BetaFood/subscriptions","organizations_url":"https://api.github.com/users/BetaFood/orgs","repos_url":"https://api.github.com/users/BetaFood/repos","events_url":"https://api.github.com/users/BetaFood/events{/privacy}","received_events_url":"https://api.github.com/users/BetaFood/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2015-11-30T23:44:10Z","updated_at":"2015-12-10T00:45:23Z","closed_at":null,"body":"The usage reported for the previous month at the month boundary does not seem to be correct. \r\nSetup: \r\n\r\n```\r\nSLACK: 2D\r\nresource: linux-container \r\n```\r\n\r\n\r\nThree submissions as follows:\r\n\r\n- usage 1 start/end at 1446249600000 (Sat Oct 31 2015 00:00:00 GMT+0000 (GMT)) 2GB - submitted at 10/31 02:00 GMT\r\n- usage 2 start/end at 1446336000000 (Sun Nov 01 2015 00:00:00 GMT+0000 (GMT)) 2GB - submitted at 11/01 02:00 GMT [Artificial event inserted at the month boundary]\r\n- usage 3 start/end at 1446415200000 (Sun Nov 01 2015 22:00:00 GMT+0000 (GMT)) 1GB - submitted at 11/01 23:00 GMT\r\n\r\n```\r\n  \"usage\": [\r\n    {\r\n      \"start\": 1446249600000,\r\n      \"end\": 1446249600000,\r\n      \"region\": \"us-south\",\r\n      \"organization_id\": \"us-south:b3d7fe4d-3cb1-4cc3-a831-ffe98e20cf27\",\r\n      \"space_id\": \"baeae239-f3f8-483c-9dd0-de5d41c38b6a\",\r\n      \"consumer_id\": \"cloud-foundry-application:baaaaaaa-f3f8-483c-9dd0-de5d41c38b6a\",\r\n      \"resource_id\": \"linux-container\",\r\n      \"plan_id\": \"basic\",\r\n      \"resource_instance_id\": \"cloud-foundry-application:baaaaaaa-f3f8-483c-9dd0-de5d41c38b6a\",\r\n      \"measured_usage\": [\r\n        {\r\n          \"measure\": \"instance_memory\",\r\n          \"quantity\": 1073741824\r\n        },\r\n        {\r\n          \"measure\": \"running_instances\",\r\n          \"quantity\": 2\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}\r\n\r\n```\r\n\r\n```\r\n{\r\n  \"usage\": [\r\n    {\r\n      \"start\": 1446336000000,\r\n      \"end\": 1446336000000,\r\n      \"region\": \"us-south\",\r\n      \"organization_id\": \"us-south:b3d7fe4d-3cb1-4cc3-a831-ffe98e20cf27\",\r\n      \"space_id\": \"baeae239-f3f8-483c-9dd0-de5d41c38b6a\",\r\n      \"consumer_id\": \"cloud-foundry-application:baaaaaaa-f3f8-483c-9dd0-de5d41c38b6a\",\r\n      \"resource_id\": \"linux-container\",\r\n      \"plan_id\": \"basic\",\r\n      \"resource_instance_id\": \"cloud-foundry-application:baaaaaaa-f3f8-483c-9dd0-de5d41c38b6a\",\r\n      \"measured_usage\": [\r\n        {\r\n          \"measure\": \"instance_memory\",\r\n          \"quantity\": 1073741824\r\n        },\r\n        {\r\n          \"measure\": \"running_instances\",\r\n          \"quantity\": 2\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}\r\n\r\n```\r\n\r\n```\r\n  \"usage\": [\r\n    {\r\n      \"start\": 1446415200000,\r\n      \"end\": 1446415200000,\r\n      \"region\": \"us-south\",\r\n      \"organization_id\": \"us-south:b3d7fe4d-3cb1-4cc3-a831-ffe98e20cf27\",\r\n      \"space_id\": \"baeae239-f3f8-483c-9dd0-de5d41c38b6a\",\r\n      \"consumer_id\": \"cloud-foundry-application:baaaaaaa-f3f8-483c-9dd0-de5d41c38b6a\",\r\n      \"resource_id\": \"linux-container\",\r\n      \"plan_id\": \"basic\",\r\n      \"resource_instance_id\": \"cloud-foundry-application:baaaaaaa-f3f8-483c-9dd0-de5d41c38b6a\",\r\n      \"measured_usage\": [\r\n        {\r\n          \"measure\": \"instance_memory\",\r\n          \"quantity\": 1073741824\r\n        },\r\n        {\r\n          \"measure\": \"running_instances\",\r\n          \"quantity\": 1\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nRetrieve report at 2015-11-03T05:00:57Z which is after the SLACK period of 2 days \r\n\r\n```\r\ncurl -v http://localhost:9088/v1/metering/organizations/us-south%3Ab3d7fe4d-3cb1-4cc3-a831-ffe98e20cf27/aggregated/usage\r\n```\r\n\r\nSince there were two instances of the application with 1GB of memory running in October for 24 hours, \r\nthe aggregated usage should be 24 hours * 2 instances - 48 hours or 172800000 milliseconds. \r\n\r\nBut the report shows the following month usage\r\n\r\n```\r\n                [\r\n                  {\r\n                    \"quantity\": {\r\n                      \"consumed\": 158400000,\r\n                      \"consuming\": 1,\r\n                      \"since\": 1446415200000\r\n                    },\r\n                    \"cost\": {\r\n                      \"burned\": 22176,\r\n                      \"burning\": 0.00014,\r\n                      \"since\": 1446415200000\r\n                    },\r\n                    \"summary\": 75.0578675,\r\n                    \"charge\": 0.01050810145\r\n                  },\r\n                  {\r\n                    \"quantity\": {\r\n                      \"consumed\": 0,\r\n                      \"consuming\": 4,\r\n                      \"since\": 1446249600000\r\n                    },\r\n                    \"cost\": {\r\n                      \"burned\": 0,\r\n                      \"burning\": 0.00056,\r\n                      \"since\": 1446249600000\r\n                    },\r\n                    \"summary\": 308.23147,\r\n                    \"charge\": 0.0431524058\r\n                  }\r\n                ]\r\n```\r\n\r\nThe full report is attached\r\n\r\n[scenario-1-linux.json.txt](https://github.com/cloudfoundry-incubator/cf-abacus/files/47939/scenario-1-linux.json.txt)\r\n"},"comment":{"url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/issues/comments/163449531","html_url":"https://github.com/cloudfoundry-incubator/cf-abacus/issues/182#issuecomment-163449531","issue_url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/issues/182","id":163449531,"user":{"login":"piotrprzybylski","id":4493924,"avatar_url":"https://avatars.githubusercontent.com/u/4493924?v=3","gravatar_id":"","url":"https://api.github.com/users/piotrprzybylski","html_url":"https://github.com/piotrprzybylski","followers_url":"https://api.github.com/users/piotrprzybylski/followers","following_url":"https://api.github.com/users/piotrprzybylski/following{/other_user}","gists_url":"https://api.github.com/users/piotrprzybylski/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrprzybylski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrprzybylski/subscriptions","organizations_url":"https://api.github.com/users/piotrprzybylski/orgs","repos_url":"https://api.github.com/users/piotrprzybylski/repos","events_url":"https://api.github.com/users/piotrprzybylski/events{/privacy}","received_events_url":"https://api.github.com/users/piotrprzybylski/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T00:45:23Z","updated_at":"2015-12-10T00:45:23Z","body":"I also agree, the calculations should be independent of slack setting."}}