Skip to content

Latest commit

 

History

History
67 lines (55 loc) · 983 Bytes

grafana_queries.md

File metadata and controls

67 lines (55 loc) · 983 Bytes

Healthcare Facilities Grafana Dashboard

Response time:

SELECT 
  timestamp AS time,
  response_time
FROM conversations
ORDER BY timestamp

Relevance:

SELECT 
  relevance,
  COUNT(*) AS count
FROM conversations
WHERE timestamp BETWEEN $__timeFrom() AND $__timeTo() 
GROUP BY relevance

Model used:

SELECT
  model_used,
  COUNT(*) AS count
FROM conversations
WHERE timestamp BETWEEN $__timeFrom() AND $__timeTo() 
GROUP BY model_used

Openai cost:

SELECT
  timestamp AS time,
  openai_cost
FROM conversations
WHERE openai_cost > 0
ORDER BY timestamp

Recent conversations:

SELECT
  timestamp AS time,
  question,
  answer,
  relevance
FROM conversations
ORDER BY timestamp DESC
LIMIT 5

Feedback statistics:

SELECT 
  SUM(CASE WHEN feedback > 0 THEN 1 ELSE 0 END) as thumbs_up,
  SUM(CASE WHEN feedback < 0 THEN 1 ELSE 0 END) as thumbs_down
FROM feedback
WHERE timestamp BETWEEN $__timeFrom() AND $__timeTo()