Problem/Motivation

The core metrics include nodes and comments, but don't include users, although a site can have no nodes, but cannot have no users.

Steps to reproduce

Enable all Prometheus modules.

Proposed resolution

Include a UserCount plugin in the base exporter.

Remaining tasks

Do it.

User interface changes

Extra choice on admin/config/system/prometheus_exporter

API changes

None

Data model changes

config/install contains an extra entry.

Comments

fgm created an issue. See original summary.

fgm’s picture

Status: Active » Needs review
StatusFileSize
new3.33 KB

Suggested implementation.

kim.pepper’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Looking good, although we need tests. There are examples in \Drupal\Tests\prometheus_exporter\Unit\Plugin\MetricsCollector

fgm’s picture

Status: Needs work » Needs review
StatusFileSize
new8.22 KB

Done. I don't like the multiple willReturn() mechanism much, because it appears to be undocumented: it would seem more logical to have a single mock userQuery returning different values based on the condition calls, but I don't see how to do it, so...

kim.pepper’s picture

Status: Needs review » Needs work
Issue tags: -Needs tests +Needs reroll

This needs a re-roll against the 8.x-1.x branch.

fgm’s picture

Status: Needs work » Needs review
StatusFileSize
new6.32 KB

Here it is. Quite shorter indeed.

  • kim.pepper committed 4506e75 on 8.x-1.x authored by fgm
    Issue #3162432 by fgm: Include user metrics
    
kim.pepper’s picture

Status: Needs review » Fixed

Committed and pushed to 8.x-1.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.