project Utilities / File Location Listing avatar

utilities/file_location_listing#40: Stats endpoint



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: v0.2.5
Created: 09-Jan-24 13:24



Description

To enable monitoring and, to some extent, aid performance improvements, I'd like to add a stats endpoint.

It should:

  • Report number of items in the loaded index(es)
  • Report time since last index load

Eventually, I'd like to have it also report query performance stats (mean execution times and the like), but that can come later.



Toggle State Changes

Activity


assigned to @btasker

verified

mentioned in commit b12c4839d520e44f09345786cf7a2f39577c4070

Commit: b12c4839d520e44f09345786cf7a2f39577c4070 
Author: B Tasker                            
                            
Date: 2024-01-10T19:45:01.000+00:00 

Message

feat: add stats endpoint (utilities/file_location_listing#40)

+46 -2 (48 lines changed)

This is implemented:

$ curl http://127.0.0.1:5000/stats
{
  "storage": {
    "DOC_index_cnt": 3645,
    "IMAGE_index_cnt": 2889,
    "IMPLIED_index_cnt": 10,
    "TAGS_index_cnt": 813,
    "TOMB_cnt": 0,
    "files": {
      "index": {
        "mtime": 1704625853,
        "size": 439780
      },
      "index.tomb": {},
      "tags": {
        "mtime": 1704625853,
        "size": 54696
      }
    },
    "index_last_load": 1704915863,
    "index_last_mod": 1704625853,
    "load_age_s": 122
  }
}

mentioned in issue #42