collie-cli icon indicating copy to clipboard operation
collie-cli copied to clipboard

Dates in "collie tenant cost" output don't match CLI parameters

Open JohannesRudolph opened this issue 3 years ago • 0 comments

Describe the bug Running collie tenant cost shows incosistent and unintuitive timeframes depending on how its run.

Reach of the bug I tested with Azure, but probably AWS and GCP are affected as well

Impact of the bug It's important that behavior of -- from/to parameters is intuitive and well documented. It should be possible for users to easily query consecutive periods "gap free" e.g. --from 2021-01-01 --to 2021-01-31 and --from 2021-02-01 --to 2021-02-28 should have no overlap and no gap in between.

To Reproduce Run

collie cache clear
collie tenant costs --from 2021-12-01 --to 2021-12-31

... │ (Azure) likvid-central-services │ 9.832300451794769 │ EUR │ 2021-12-01 │ 2022-01-01 │ ... 107 entries. Queried from cloud - Azure: 30.864s, AWS: 118.174s.

Notice that "to" column says 2022-01-01 instead of 2021-12-31.

Now rerun from cache collie tenant costs --from 2021-12-01 --to 2021-12-31

... │ (Azure) likvid-central-services │ 9.832300451794769 │ EUR │ 2021-12-01T00:00:00.000Z │ 2021-12-31T23:59:59.999Z ... 107 entries. Loaded from cache in 124ms. See "collie cache" for details.

Expected behavior The output from cache and running the query should be the same.

The "to" date is logically end of 2021-12-31 (though queries to cloud APIs may have to go to 2022-01-01:00:00.00Z exclusive.

Desktop (please complete the following information): macOS, I'm in timezone CEST

13:09 $ date Wed Apr 27 13:09:27 CEST 2022

JohannesRudolph avatar Apr 27 '22 11:04 JohannesRudolph