2022-01-17 Search and Sort Cache Statistics

From Izara Wiki
Jump to navigation Jump to search

Service Stack - Search and Sort

Overview

  • Want to be able to see how often complexFilter/SearchResult/SortResult (search stage) hits cache

Store statistics

  • Dynamo table
  • partition key: search stage tag
  • sort key: start timestamp

Parents record children

  • Also store for each record a list of child search stages
  • Maybe just immediate ones, and they store theirs etc, making a graph of child stages

Correlation id

  • Similar to debug logging want to add a correlation id that sets whether recording statistics
  • Have an environment variable that sets chance of recording statistics
  • Could tie into log level, eg if log level is DEBUG then always record statistics

Monitoring time spent

  • add in timestamps for each search stage so can monitor how long they take
  • Perhaps timestamp when starts and timestamp when ends

Checks in code

  • try to tie into existing functions, but might need to add additional functions when starting the request and completing it
  • might need another function that triggers when sending to a child search stage, for the parent to record it