Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions include/cdc/cdc_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class LatencyHistogram {

/**
* @brief Record a latency sample in microseconds
* @param latency_micros Sample latency value in microseconds.
*/
void record(uint64_t latency_micros) {
count_++;
Expand All @@ -59,13 +60,15 @@ class LatencyHistogram {

/**
* @brief Get count of samples
* @return Total number of recorded samples.
*/
uint64_t count() const {
return count_.load();
}

/**
* @brief Get average latency in microseconds
* @return Average latency in microseconds, or 0.0 when empty.
*/
double average() const {
uint64_t cnt = count_.load();
Expand All @@ -74,27 +77,32 @@ class LatencyHistogram {

/**
* @brief Get P50 (median) latency in microseconds
* @return Median latency in microseconds, or 0 when empty.
*/
uint64_t p50() const {
return percentile(0.50);
}

/**
* @brief Get P95 latency in microseconds
* @return 95th percentile latency in microseconds, or 0 when empty.
*/
uint64_t p95() const {
return percentile(0.95);
}

/**
* @brief Get P99 latency in microseconds
* @return 99th percentile latency in microseconds, or 0 when empty.
*/
uint64_t p99() const {
return percentile(0.99);
}

/**
* @brief Get percentile latency in microseconds
* @param p Target percentile as a fraction in the range [0.0, 1.0].
* @return Requested percentile latency in microseconds, or 0 when empty.
*/
uint64_t percentile(double p) const {
uint64_t total = count_.load();
Expand All @@ -115,6 +123,7 @@ class LatencyHistogram {

/**
* @brief Convert to JSON for monitoring
* @return JSON object containing the histogram snapshot.
*/
nlohmann::json toJson() const {
return {
Expand Down Expand Up @@ -278,6 +287,7 @@ struct CDCMetrics {

/**
* @brief Convert all metrics to JSON
* @return JSON object containing the full CDC metrics snapshot.
*/
nlohmann::json toJson() const {
return {
Expand Down
3 changes: 3 additions & 0 deletions include/governance/audit_batch_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ class AuditBatchWriter {
};
mutable std::mutex metrics_mutex_;
Metrics metrics_;
/// Rolling window of the last 1 000 submission latency samples (µs).
/// Used to compute p95 / p99 in recordMetrics(). Protected by metrics_mutex_.
std::vector<double> latency_samples_us_;

// Internal methods
void flushThread();
Expand Down
9 changes: 9 additions & 0 deletions src/acceleration/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,15 @@ All major GPU acceleration backends are now fully implemented and integrated:
- Some optional backend combinations remain environment dependent.
- Distributed and plugin-heavy scenarios need continuous hardening evidence.

## Wave 3 Gap-Closure Tracking (2026-08-31)

- [~] `break_even_validator.cc` — Prometheus metrics not yet emitted from
`BreakEvenDecision::ToString()`, `CacheEntry::IsExpired()`, and
`BreakEvenValidator` constructor. Wire observability counters/gauges via the
existing metrics registry once a Prometheus handle is available on the
BreakEvenValidator instance. Target: Q2 2027.
Tracking comment added in source at `break_even_validator.cc:180`.

## Breaking Changes

- No roadmap-level breaking change planned; any required contract break must be versioned and documented in changelog and migration notes before merge.
2 changes: 2 additions & 0 deletions src/acceleration/break_even_validator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ std::string WorkloadProfile::ToString() const {
// ============================================================================

std::string BreakEvenDecision::ToString() const {
// NOTE: Prometheus metric emission for BreakEvenDecision is not yet wired.
// Tracked: src/acceleration/ROADMAP.md § "BreakEvenValidator Prometheus Metrics"
return fmt::format(
"BreakEvenDecision{{use_gpu={}, speedup={:.2f}x, cpu={}ms, gpu={}ms, reason={}, cached={}}}",
use_gpu ? "true" : "false",
Expand Down
13 changes: 12 additions & 1 deletion src/chimera/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

Production adapter runtime (v0.0.47, 96/100 maturity score) exists for the current ThemisDB adapter implementation, including simulation-mode behavior and conditional engine-dispatch integration surfaces. Core module documentation is aligned to source-verifiable behavior. Build system corrected 2026-07-27 (CMakeLists.txt).

**Gap-Closure Wave 2 (2026-08-31):** All MongoDB, Neo4j, and Qdrant adapter methods that previously silently returned `ok` without a real library now:
- Are guarded by `#ifdef THEMIS_CHIMERA_MONGO` / `#ifdef THEMIS_CHIMERA_NEO4J` / `#ifdef THEMIS_CHIMERA_QDRANT`
- Return `ErrorCode::NOT_IMPLEMENTED` with an actionable message in the `#else` branch
- Carry `// NOT IMPLEMENTED: Requires <library>. Gate: THEMIS_CHIMERA_<NAME>` comments
- Do **not** silently report success when the library is unavailable

## In Progress

- [~] hardening parity between simulation-mode and engine-backed dispatch paths (Target: Q3 2026, evidence: 2200+ test LOC)
Expand All @@ -17,7 +23,11 @@ Production adapter runtime (v0.0.47, 96/100 maturity score) exists for the curre
- [~] v1.1.0: Transaction Management with ACID properties and savepoints (Target: Q3 2026)
- [~] v1.1.0: Error Recovery with exponential backoff retry strategy (Target: Q3 2026)
- [~] v1.1.0: Batch Operation Optimization for throughput (Target: Q3 2026)
- [ ] v1.2.0: MongoDB/Qdrant/Neo4j Real Driver Integration (Target: Q4 2026)
- [~] v1.2.0: MongoDB/Qdrant/Neo4j Real Driver Integration (Target: Q4 2026)
- [x] Gap-Closure Wave 2 (2026-08-31): `#ifdef` guards + fail-closed `NOT_IMPLEMENTED` returns for all adapter methods requiring `mongocxx` / `neo4j-cpp-driver` / `qdrant-client-cpp`
- [ ] Wire real `mongocxx::client` behind `THEMIS_CHIMERA_MONGO` (Target: Q4 2026)
- [ ] Wire real `neo4j-cpp-driver` behind `THEMIS_CHIMERA_NEO4J` (Target: Q4 2026)
- [ ] Wire real `qdrant-client-cpp` gRPC calls behind `THEMIS_CHIMERA_QDRANT` (Target: Q4 2026)

## Planned Features

Expand All @@ -42,6 +52,7 @@ Production adapter runtime (v0.0.47, 96/100 maturity score) exists for the curre
- [ ] align simulation and engine-backed behavior to bounded runtime contracts (Target: Q4 2026)

### Phase 3: Error Handling and Edge Cases
- [x] Gap-Closure Wave 2: all third-party adapter methods return `NOT_IMPLEMENTED` when library not compiled in — no silent success (2026-08-31)
- [ ] standardize fail-closed behavior for invalid connection/dispatch states (Target: Q4 2026)
- [ ] unify diagnostics across capability mismatch and unsupported-path classes (Target: Q4 2026)

Expand Down
Loading
Loading