Skip to content

Add consumers metric to metrics command - #94

Merged
itssimon merged 3 commits into
mainfrom
feat/consumers-metric
Oct 28, 2026
Merged

itssimon merged 3 commits into
mainfrom
feat/consumers-metric

Conversation

@itssimon

@itssimon itssimon commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Adds support for the new consumers metric of POST /v1/apps/{app_id}/metrics (apitally/cloud#1549): the number of distinct consumers per row.

  • Adds a consumers BIGINT column to the DuckDB metrics table (with ALTER TABLE ... ADD COLUMN IF NOT EXISTS for existing databases).
  • Lists consumers after requests_per_minute in the --metrics help text, the skill's command reference, and the DuckDB schema reference.
  • Extends test_run_with_db to cover the new column.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@itssimon
itssimon enabled auto-merge (squash) October 28, 2026 06:54

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 3 files (changes from recent commits).

Confidence score: 4/5

  • In skills/apitally-cli/references/commands.md, omitting the caveat could lead users to double-count consumers when aggregating DuckDB rows or NDJSON output. Restore the note that distinct counts can’t be summed across periods or groups.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="skills/apitally-cli/references/commands.md">

<violation number="1" location="skills/apitally-cli/references/commands.md:115">
P2: The new `consumers` documentation omits that this distinct count cannot be summed across periods or groups. Users aggregating the DuckDB rows or NDJSON output can therefore double-count consumers; restore the caveat in the command reference, CLI help, and schema reference.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

| --------------------- | ------- | -------------------------------------- |
| `requests` | integer | Total request count |
| `requests_per_minute` | float | Requests per minute |
| `consumers` | integer | Number of distinct consumers |

@cubic-dev-ai cubic-dev-ai Bot Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: The new consumers documentation omits that this distinct count cannot be summed across periods or groups. Users aggregating the DuckDB rows or NDJSON output can therefore double-count consumers; restore the caveat in the command reference, CLI help, and schema reference.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At skills/apitally-cli/references/commands.md, line 115:

<comment>The new `consumers` documentation omits that this distinct count cannot be summed across periods or groups. Users aggregating the DuckDB rows or NDJSON output can therefore double-count consumers; restore the caveat in the command reference, CLI help, and schema reference.</comment>

<file context>
@@ -108,21 +108,21 @@ Fetch aggregated metrics for an app. Outputs NDJSON to stdout by default.
+| --------------------- | ------- | -------------------------------------- |
+| `requests`            | integer | Total request count                    |
+| `requests_per_minute` | float   | Requests per minute                    |
+| `consumers`           | integer | Number of distinct consumers           |
+| `bytes_received`      | integer | Total bytes received                   |
+| `bytes_sent`          | integer | Total bytes sent                       |
</file context>
Fix with cubic

@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.89%. Comparing base (ea3b464) to head (c700a4b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #94      +/-   ##
==========================================
+ Coverage   91.88%   91.89%   +0.01%     
==========================================
  Files          13       13              
  Lines        2477     2481       +4     
==========================================
+ Hits         2276     2280       +4     
  Misses        201      201              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@itssimon
itssimon merged commit 8d58c5e into main Oct 28, 2026
7 checks passed
@itssimon
itssimon deleted the feat/consumers-metric branch October 28, 2026 07:16
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.

1 participant