Skip to content

Statistics Server

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.

The statistics server requires SMTP credentials for sending email notifications:

Terminal window
stat.flexfs init creds \
--smtpAddr $SMTP_HOST:587 \
--smtpFrom $SMTP_FROM \
--smtpTo $SMTP_TO \
--smtpUser $USERNAME \
--smtpPass $PASSWORD

If --smtpPass is omitted, the command prompts interactively.

init creds flags:

FlagTypeDefaultDescription
--smtpAddrstringemail-smtp.us-east-1.amazonaws.com:587SMTP server address
--smtpFromstringflexFS Service <no-reply@ses.flexfs.io>Sender email address
--smtpTostring(internal default)Comma-separated list of recipient email addresses
--smtpUserstring(internal default)SMTP username
--smtpPassstring(prompts)SMTP password
--forceboolfalseOverwrite an existing credentials file
Terminal window
sudo stat.flexfs init systemd --now
FlagTypeDefaultDescription
--bindAddrstring0.0.0.0:443Address and port to bind
--dbFolderstring~/.flexfs/statDatabase folder path
--keyFolderstring~/.flexfs/licenseLicense signing key folder path
--noSSLboolfalseDisable TLS
--sslCertstring~/.flexfs/ssl/certTLS certificate file path
--sslKeystring~/.flexfs/ssl/keyTLS private key file path
--verbose / -vboolfalseEnable verbose logging

Hidden flags [internal]:

FlagTypeDefaultDescription
--pprofboolfalseEnable the Go pprof profiler (port 6065)
--sqliteOptsstring(default tuning)Database connection tuning options
--smtpAddrstring(from creds)SMTP server address (overrides credentials file)
--smtpFromstring(from creds)Sender email (overrides credentials file)
--smtpPassstring(from creds)SMTP password (overrides credentials file)
--smtpTostring(from creds)Recipient emails (overrides credentials file)
--smtpUserstring(from creds)SMTP username (overrides credentials file)
--mockTimeboolfalseTesting flag: simulate time progression
  1. Admin servers periodically report volume usage statistics to the statistics server.
  2. The statistics server stores these reports in its database.
  3. At configured intervals, it generates usage summaries and sends them via email to the configured recipients.
  4. The database retains historical usage data for billing reconciliation.

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.