diff options
Diffstat (limited to 'Omni/Agent/Worker.hs')
| -rw-r--r-- | Omni/Agent/Worker.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs index 7afc849..3504765 100644 --- a/Omni/Agent/Worker.hs +++ b/Omni/Agent/Worker.hs @@ -262,11 +262,11 @@ parseAndUpdate line = do _ -> pure () -- Extract cost from usage-ledger:event - -- Pattern: {"totalCredits": 1.54, "message": "usage-ledger:event", ...} - -- We use totalCredits to be robust against missed lines and restarts. + -- Pattern: {"totalCredits": 154.0, "message": "usage-ledger:event", ...} + -- The credits are in cents, so we divide by 100 to get dollars. case KM.lookup "totalCredits" obj of Just (Aeson.Number n) -> - let total = Scientific.toRealFloat n + let total = Scientific.toRealFloat n / 100.0 in AgentLog.update (\s -> s {AgentLog.statusCredits = total}) _ -> pure () |
