| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Merge master into 11-Dev Conflicts: include/ts/ts.h include/tscore/ArgParser.h src/iocore/cache/P_CacheHosting.h src/proxy/ReverseProxy.cc src/tscore/ArgParser.cc | 5 个月前 | |
Add hidden metrics and MAX/MIN/incremental derived metric aggregation (#13505) * tsutil: make the Metrics unit tests order independent The tests asserted absolute metric ids and iterator positions, which only hold when the case runs first against an otherwise empty store. Any other test case that creates a published metric makes them fail. Assert on relative state instead so the cases can run in any order. * tsutil: add a separate storage for hidden metrics Hidden metrics are stored but never published. Using a separate Storage instance rather than a per-metric flag makes them structurally unreachable from the published store, so no metric consumer can expose them by omission. Gauge and Counter each gain createHiddenPtr overloads which return the same correctly typed pointer as createPtr, so a hidden metric is read and written with the normal typed mutators and no cast is needed at the call site. * tsutil: fail gracefully when metric storage is exhausted Storage::create() had no exhaustion check, so filling the last blob let the following bookkeeping call addBlob() and write one past the end of _blobs. Refuse the final slot instead and return the reserved bad_id, which keeps addBlob() from ever being reached in a full store and costs one slot out of 8M. The guard in addBlob() was also off by one against the access it protects, since the write is to _blobs[++_cur_blob], and being a debug_assert it was compiled out of release builds entirely. Make it a release_assert against MAX_BLOBS - 1. * traffic_ctl: add --include-hidden to metric match Hidden metrics are invisible to normal queries by design, which makes them hard to debug. Add an opt-in rec type bit, deliberately outside RECT_ALL so hidden metrics are never returned unless explicitly requested. The rec type also has to be accepted by the JSONRPC request decoder, which validates each requested type against a whitelist and rejects the whole request otherwise. No wire or schema change is needed, as rec_types is already an untyped list of ints. * tsutil: support MAX and MIN aggregation for derived metrics Derived metrics could only sum their sources. Add an op to the spec so a derived metric can also take the max or min across its sources, which is what an aggregate over instantaneous gauges needs. The accumulator is seeded from the first source rather than from zero, since a zero seed is only correct for SUM and would clamp MIN to <= 0. op defaults to SUM, so existing specs are unaffected. * tsutil: skip derived metric sources that do not resolve A source given by name or id that does not resolve was still passed to lookup(), which masks the unresolved id down to the reserved bad_id slot. The aggregate then silently included that slot's value instead of skipping the source, with no error reported. Resolve each source first and skip it if it does not resolve. This is observable under MAX and MIN, where the bad_id value can become the winning one; under SUM it happened to be hidden by bad_id holding zero. * tsutil: allow adding derived metric sources at runtime derive() only accepts a fixed initializer_list, which does not work for aggregates whose sources are discovered as the process runs. Calling it repeatedly for one derived name does not help either: it appends a separate entry per call, all targeting the same metric, so each update overwrites the others with its own subset and the last writer silently wins. add_source() accumulates sources into a single entry instead. Registering a source that is already present is a no-op, so a caller that may re-register the same source need not track that itself. * doc: document hidden and derived metrics Add a developer guide page for the metrics registry covering the hidden store, how it differs from the published one and why it is a separate store rather than a flag, and the derived metric aggregation ops including when derived values are recomputed and what that means for a sampled maximum. * Tag hidden metrics with RECT_HIDDEN_METRIC as well as RECT_PROCESS The record lookup callback rejects any record whose rec_type shares no bit with the requested mask, so tagging hidden metrics RECT_PROCESS alone made a request for only RECT_HIDDEN_METRIC fail with REQUESTED_TYPE_MISMATCH. Now that the request decoder accepts that type on its own, such a request is expressible, so set both bits. Add a unit test covering the hidden-only and include-hidden requests and confirming RECT_ALL still excludes them. * Value-initialize the synthetic records in the record lookups Both lookup functions build a RecRecord on the stack for metrics, which live outside the g_records array, and hand it to the caller's callback. The JSONRPC encoder reads version, registered, rsb_id, order and data_default unconditionally, so leaving them indeterminate lets a --format json metric query emit different values on successive runs, and reading an indeterminate bool is undefined behavior. Five sites, all with the same one word fix. Only the hidden metric loop is new in this branch; the rest have had the pattern for years. * Grow a new blob when a span ends on the blob boundary createSpan checked whether a span fit before reserving it but never re-checked afterwards, so a span ending exactly on MAX_SIZE left the offset at MAX_SIZE with no new blob allocated. The next create() then wrote one past the end of that blob's name array, and end() became an id that iterator::next() can never reach, since it wraps at ++offset == MAX_SIZE. create() has always grown as soon as it consumed the last slot; do the same here. Also refuse a span that would fill or overflow the final blob, so the new growth cannot ask addBlob() to go past the last one and trip its assert. createSpan(MAX_SIZE) always starts a fresh blob and fills it exactly, whatever the current offset, so the added test reaches the boundary deterministically. It fails without the fix. * Polish the --include-hidden surface Three small corrections to the flag added earlier in this branch: Skip slot 0 when walking the hidden store. Every Storage reserves it for the bad_id placeholder, so it exists under the same name in both stores and a query matching it returned two records differing only in value, in exactly the debugging situation the flag is for. Scope the option to 'match' with a nested program directive. As a bare option under 'traffic_ctl metric' it rendered as a peer of get, match and describe, so it read as another subcommand rather than a flag on match. This follows the 'config get --records' pattern earlier in the file. Put the flag before the positional in the CLI example usage so it agrees with that synopsis, which is also the convention the rest of the file uses. | 19 天前 | |
Add uds-perm/uds-user/uds-group port options | 1 个月前 | |
Unified include paths (#10671) This PR does the following: * Updates the common include path used by all modules. * The #include lines in code are updated to the relative path to the updated include paths or to where the including files are. * Most include_directories are cleaned up in cmake files. The common include path are the following: # Common includes for everyone include_directories(${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include) Also, since we are here,moved the private header (P_xxx) and test headers from include/records back to the src/records. | 2 年前 | |
clang-format v18 + modified configs (#11285) | 2 年前 | |
Event metrics cleanup (#12565) * Eventloop status use new Metrics * remove comment * Fix EventStatsBlock::STAT_COUNT * Remove P_RecProcess.h | 9 个月前 | |
traffic_ctl: Display `YAML` format when `--records` option is set (instead of the legacy `records.config` style) (#11650) traffic_ctl: Display YAML format when --records option is set. It make sense to display YAML instead of the legacy format in case this out wants to be used as input for ATS. A new bunch of function are added only for traffic_ctl to build up yaml from the record's name. This code uses YAML::Emitter so we can add comments to the yaml doc, this is essential as we are including things like defaults values in Each field, this can only be accomplished with Emitters. | 2 年前 | |
Include records.yaml line and column in the logs when error is found. (#12267) For instance, with the following config: records: http: per_server: connection: match: both*ioajs new: field: 11: We will get a warning log with the line and the column from the records.yaml file exactly where the error was detected. In the above example, match and new.field have different sort of errors but both now log the line+column. WARNING: We have found the following issues when reading the records node: Warn: Warn: proxy.config.http.per_server.connection.match - Validity Check error at line=37, col=9. Pattern '^(?:ip|host|both|none)$' failed against 'both*ioajs'. Default value will be used Warn: Ignoring field 'field' [proxy.config.http.per_server.connection.new.field] at line=39, col=11. Not registered and Unknown tag type '? | 1 年前 | |
RecordsConfig.cc: Ensure RechCheckT/regex consistency (#12413) It is easy to get lost in the meaning of the various RecordElement specifications when adding a new configuration element. We have several configurations that have regexes specified to verify sane user input but do not have a RecCheckT provided. If the RechCheckT is RECC_NULL, the regex is not used (see RecordValidityCheck). Thus this is always a mistake. This patch adds a compile-time check that RecCheckT is non-RECC_NULL if regex is provided and fixes those that violate this validation. It also adds as a compile time check that is done as a runtime check in initialize_record() that if RechCheckT is non-RECC_NULL, regex is non-nullptr. | 1 年前 | |
Improve config reload error reporting with severity-aware task logs (#13090) * Add severity-aware logging to config reload framework Unify diagnostic logging (diags.log) with ConfigContext task logs (traffic_ctl config status) via CfgLoad* macros. Each task log entry now carries a DiagsLevel severity, enabling --min-level filtering in traffic_ctl and severity tags in output ([Note], [Err], etc). Reload summaries are logged to diags.log after a grace period, with detailed per-subtask dumps under the config.reload debug tag. Fixes: #12963 | 4 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 5 个月前 | ||
| 19 天前 | ||
| 1 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 9 个月前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 4 个月前 |