Statistics Server
Overview
Section titled “Overview”The statistics server collects usage data from admin servers, tracks storage consumption over time, and generates billing reports. It sends periodic email notifications with usage summaries.
Initialize credentials
Section titled “Initialize credentials”The statistics server requires SMTP credentials for sending email notifications:
stat.flexfs init creds \ --smtpAddr $SMTP_HOST:587 \ --smtpFrom $SMTP_FROM \ --smtpTo $SMTP_TO \ --smtpUser $USERNAME \ --smtpPass $PASSWORDIf --smtpPass is omitted, the command prompts interactively.
init creds flags:
| Flag | Type | Default | Description |
|---|---|---|---|
--smtpAddr | string | email-smtp.us-east-1.amazonaws.com:587 | SMTP server address |
--smtpFrom | string | flexFS Service <no-reply@ses.flexfs.io> | Sender email address |
--smtpTo | string | (internal default) | Comma-separated list of recipient email addresses |
--smtpUser | string | (internal default) | SMTP username |
--smtpPass | string | (prompts) | SMTP password |
--force | bool | false | Overwrite an existing credentials file |
Create systemd service
Section titled “Create systemd service”sudo stat.flexfs init systemd --nowStart flags
Section titled “Start flags”| Flag | Type | Default | Description |
|---|---|---|---|
--bindAddr | string | 0.0.0.0:443 | Address and port to bind |
--dbFolder | string | ~/.flexfs/stat | Database folder path |
--keyFolder | string | ~/.flexfs/license | License signing key folder path |
--noSSL | bool | false | Disable TLS |
--sslCert | string | ~/.flexfs/ssl/cert | TLS certificate file path |
--sslKey | string | ~/.flexfs/ssl/key | TLS private key file path |
--verbose / -v | bool | false | Enable verbose logging |
Hidden flags [internal]:
| Flag | Type | Default | Description |
|---|---|---|---|
--pprof | bool | false | Enable the Go pprof profiler (port 6065) |
--sqliteOpts | string | (default tuning) | Database connection tuning options |
--smtpAddr | string | (from creds) | SMTP server address (overrides credentials file) |
--smtpFrom | string | (from creds) | Sender email (overrides credentials file) |
--smtpPass | string | (from creds) | SMTP password (overrides credentials file) |
--smtpTo | string | (from creds) | Recipient emails (overrides credentials file) |
--smtpUser | string | (from creds) | SMTP username (overrides credentials file) |
--mockTime | bool | false | Testing flag: simulate time progression |
How it works
Section titled “How it works”- Admin servers periodically report volume usage statistics to the statistics server.
- The statistics server stores these reports in its database.
- At configured intervals, it generates usage summaries and sends them via email to the configured recipients.
- The database retains historical usage data for billing reconciliation.
Connection to the admin server
Section titled “Connection to the admin server”The admin server is configured with the statistics server address via the --statAddr flag (an internal flag on admin.flexfs). The admin server pushes usage reports to the statistics server over HTTPS.