fabric-testbed / fabric-core-api

Python (Flask) based ReSTful API for FABRIC Core User Services
MIT License
0 stars 0 forks source link

basic core-api metrics for portal to display #66

Closed mjstealey closed 3 months ago

mjstealey commented 8 months ago

Overview

Create core-api metrics endpoint(s) that provide real-time information for

refresh timeout interval based on .env settings

# Task Timeout Interval
export CAM_DESCRIPTION='Core API Metrics'
export CAM_NAME='core_api_metrics'
export CAM_TIMEOUT_IN_SECONDS=300

Example output:

{
  "results": [
    {
      "last_updated": "2024-04-30 19:42:20.316671+00:00",
      "projects": {
        "active_cumulative": 164,
        "non_active_cumulative": 0
      },
      "users": {
        "active_cumulative": 1392,
        "active_within_180_days": 959,
        "active_within_24_hours": 95,
        "active_within_30_days": 374,
        "active_within_7_days": 218,
        "active_within_90_days": 640,
        "non_active_cumulative": 31
      }
    }
  ],
  "size": 1,
  "status": 200,
  "type": "core_api_metrics.overview"
}