Api response latency measurement
Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder
npx -y skills add HolobiomicsLab/asb-skill-collections --skill api-response-latency-measurementAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when when annotating .msp files with metadata from multiple external web services and you need to monitor which services are slow or unreliable.
The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
7.3 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
api-response-latency-measurement
Summary
Measure and aggregate HTTP response latencies from external web services (CIR, CTS, PubChem, IDSM, BridgeDb) during asynchronous annotation runs in MSMetaEnhancer. This skill enables detection of service degradation and bottlenecks in metadata fetching workflows.
When to use
When annotating .msp files with metadata from multiple external web services and you need to monitor which services are slow or unreliable. Apply this skill if you are running asynchronous annotation jobs and want to track per-service performance degradation over time or across multiple annotation runs.
When NOT to use
- You are using only local, in-process converters (e.g., RDKit) with no external web service calls.
- Your annotation workflow is synchronous and does not require concurrent service monitoring.
- You only care about whether a service succeeded or failed, not timing performance.
Inputs
- HTTP request/response pairs from external web services during annotation
- Asynchronous task logs containing request start and end timestamps
- Service endpoint URLs (CIR, CTS, PubChem, IDSM, BridgeDb)
- .msp file annotation job configuration with service list
Outputs
- JSON report file with per-service latency metrics (mean, std, percentiles, min/max)
- Monitor object with aggregated latency state for each registered service
- Time-series latency logs for trend analysis across annotation runs
How to apply
Design a Monitor class that registers all available web services (CIR, CTS, PubChem, IDSM, BridgeDb) and initializes per-service state trackers. Implement asynchronous health-check methods that probe each web converter's endpoint and record HTTP status codes and response times. Add error-logging callbacks to the WebConverter base class to capture request timing data and route it to Monitor for aggregation. At configurable intervals, compute per-service metrics including mean latency, latency percentiles, and latency trends. Serialize aggregated latency statistics to a JSON report file with timestamp and per-service summary, allowing downstream analysis of service performance patterns.
Related tools
- MSMetaEnhancer (Host application that executes asynchronous annotation jobs and owns the Monitor class for latency tracking) — https://github.com/RECETOX/MSMetaEnhancer
- CIR (External web service for chemical structure queries; response latency measured and aggregated by Monitor) — https://cactus.nci.nih.gov/chemical/structure_documentation
- CTS (External web service for chemical name/structure conversion; latency tracked per-request) — https://cts.fiehnlab.ucdavis.edu/
- PubChem (External web service for chemical metadata; HTTP response times recorded and aggregated) — https://pubchem.ncbi.nlm.nih.gov/
- IDSM (External web service for chemical structure and name queries; latency monitored) — https://idsm.elixir-czech.cz/
- BridgeDb (External web service for identifier mapping; response latency measured per-call) — https://bridgedb.github.io/
- pytest (Testing framework to validate Monitor report structure, latency values, and service registration completeness)
Examples
from MSMetaEnhancer.libs.monitor import Monitor; monitor = Monitor(services=['CIR', 'CTS', 'PubChem', 'IDSM', 'BridgeDb']); await monitor.run_health_checks(); report = monitor.aggregate_metrics(); monitor.serialize_report('service_latency_report.json')
Evaluation signals
- JSON report file is valid JSON schema with 'timestamp', 'services', and 'overall_health' keys present
- All five registered services (CIR, CTS, PubChem, IDSM, BridgeDb) appear in the latency report
- Per-service latency metrics (mean, min, max, count) are non-negative numbers and mean ≥ min and mean ≤ max
- Latency values are within reasonable bounds for network requests (> 0ms, typically < 30,000ms for web APIs)
- Report timestamp is valid and recent relative to annotation job completion time
Limitations
- Latency measurement reflects network round-trip time only; does not account for local processing overhead in annotation logic.
- Measurement accuracy depends on system clock precision and may be affected by high CPU contention on the host machine.
- Asynchronous scheduling overhead (task queue, event loop latency) is not separated from actual HTTP service latency.
- If a service is completely unavailable (connection refused), latency may be recorded as timeout duration rather than true response time.
- Latency aggregation at configurable intervals may miss transient spikes or brief service degradation between report windows.
Evidence
- [other] MSMetaEnhancer fetches metadata from five external web services: CIR, CTS, PubChem, IDSM, and BridgeDb: "MSMetaEnhancer fetches metadata from five external web services: CIR, CTS, PubChem, IDSM, and BridgeDb, using an asynchronous implementation for the annotation process."
- [other] Implement asynchronous service health-check methods that probe each web converter's endpoint and record HTTP status codes and response times: "Implement asynchronous service health-check methods that probe each web converter's endpoint and record HTTP status codes and response times."
- [other] Create a status-aggregation method that computes per-service metrics (availability percentage, total errors, mean latency) at configurable intervals: "Create a status-aggregation method that computes per-service metrics (availability percentage, total errors, mean latency) at configurable intervals."
- [other] Serialize the aggregated status to a JSON report file with timestamp, per-service summary, and overall health state: "Serialize the aggregated status to a JSON report file with timestamp, per-service summary, and overall health state."
- [readme] The app uses asynchronous implementation of annotation process allowing for optimal fetching speed: "The app uses asynchronous implementation of annotation process allowing for optimal fetching speed."
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.