project Utilities / File Location Listing avatar

utilities/file_location_listing#42: Add query time stats to stats endpoint



Issue Information

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

Milestone: v0.2.6
Created: 13-Jan-24 12:30



Description

In #40 we added the /stats endpoint - currently it gives details about the number of items in indexes etc.

I'd like the portal to keep counters of:

  • Time spent servicing queries
  • Number of queries serviced

Ideally, per index type. That way we can start to graph out average query durations and the like. If possible (it may not be feasible) it'd probably also be useful to include a counter for number of results returned etc.



Toggle State Changes

Activity


assigned to @btasker

verified

mentioned in commit c025704d77cfa4df36342559e128f2b618cb21c6

Commit: c025704d77cfa4df36342559e128f2b618cb21c6 
Author: B Tasker                            
                            
Date: 2024-01-13T13:14:50.000+00:00 

Message

feat: add search timings and counts to stats (utilities/file_location_listing#42)

+55 -5 (60 lines changed)

There's now a search attribute in the stats:

  "search": {
    "ALL": {
      "count": 0,
      "mean_results": 0,
      "mean_search_time_ns": 0,
      "results_selected": 0,
      "total_time": 0
    },
    "DOC": {
      "count": 0,
      "mean_results": 0,
      "mean_search_time_ns": 0,
      "results_selected": 0,
      "total_time": 0
    },
    "IMAGE": {
      "count": 0,
      "mean_results": 0,
      "mean_search_time_ns": 0,
      "results_selected": 0,
      "total_time": 0
    }
}

Similar entries have been added to the storage attribute to show details of file loads:

    "index": {
      "loaded_entries": 39,
      "loads": 1,
      "time_ns": 613699
    },
    "store_files": {
      "fails": 0,
      "loads": 0,
      "time_ns": 0
    }