GetCacheStats returns (count, totalBytes) for pricing_cache.
()
| 208 | |
| 209 | // GetCacheStats returns (count, totalBytes) for pricing_cache. |
| 210 | func (d *DB) GetCacheStats() (int, int, error) { |
| 211 | var count, size int |
| 212 | err := d.conn.QueryRow("SELECT COUNT(*), COALESCE(SUM(LENGTH(response_json)),0) FROM pricing_cache").Scan(&count, &size) |
| 213 | return count, size, err |
| 214 | } |
| 215 | |
| 216 | // MakeCacheKey produces a deterministic cache key from query parameters. |
| 217 | func MakeCacheKey(providers, regions, categories, productFamilies []string, attrs map[string]string, prices []string) string { |
no outgoing calls
no test coverage detected