mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-29 02:33:06 +00:00
very experimental attempt to find threshold breach using chronos modification
This commit is contained in:
parent
91bb6daa19
commit
8cf22775e9
@ -337,6 +337,30 @@ proc initRestApi*(node: CodexNodeRef, conf: CodexConf, loopMeasure: LoopMeasure)
|
||||
trace "debug/peer returning peer record"
|
||||
return RestApiResponse.response($json)
|
||||
|
||||
when defined(chronosDurationThreshold):
|
||||
var breaches = newSeq[string]()
|
||||
proc onBreach(stackTrace: string, durationUs: int64) =
|
||||
error "Duration threshold breached", durationUs, stackTrace
|
||||
breaches.add($durationUs & " usecs at " & stackTrace)
|
||||
|
||||
setChronosDurationThresholdBreachedHandler(onBreach)
|
||||
|
||||
router.api(
|
||||
MethodGet,
|
||||
"/api/codex/v1/debug/loop") do () -> RestApiResponse:
|
||||
|
||||
let jarray = newJArray()
|
||||
for entry in breaches:
|
||||
jarray.add(%*entry)
|
||||
# "entry": entry
|
||||
# })
|
||||
|
||||
let jobj = %*{
|
||||
"breaches": jarray
|
||||
}
|
||||
|
||||
return RestApiResponse.response($jobj)
|
||||
|
||||
router.api(
|
||||
MethodGet,
|
||||
"/api/codex/v1/sales/slots") do () -> RestApiResponse:
|
||||
|
||||
1041
docker/asyncfutures2.nim
Normal file
1041
docker/asyncfutures2.nim
Normal file
File diff suppressed because it is too large
Load Diff
1273
docker/asyncloop.nim
Normal file
1273
docker/asyncloop.nim
Normal file
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@ ARG BUILDER=ubuntu:lunar-20230415
|
||||
ARG IMAGE=${BUILDER}
|
||||
ARG BUILD_HOME=/src
|
||||
ARG MAKE_PARALLEL=${MAKE_PARALLEL:-4}
|
||||
ARG NIMFLAGS="${NIMFLAGS:-"-d:disableMarchNative -d:chronosFutureTracking -d:codex_enable_api_debug_peers=true"}"
|
||||
ARG NIMFLAGS="${NIMFLAGS:-"-d:disableMarchNative -d:chronosDurationThreshold=1000000 -d:chronosFutureTracking -d:codex_enable_api_debug_peers=true"}"
|
||||
ARG APP_HOME=/codex
|
||||
ARG NAT_IP_AUTO=${NAT_IP_AUTO:-false}
|
||||
|
||||
@ -21,6 +21,8 @@ WORKDIR ${BUILD_HOME}
|
||||
COPY . .
|
||||
RUN make clean
|
||||
RUN make -j ${MAKE_PARALLEL} update
|
||||
COPY docker/asyncfutures2.nim ./vendor/nim-chronos/chronos
|
||||
COPY docker/asyncloop.nim ./vendor/nim-chronos/chronos
|
||||
RUN make -j ${MAKE_PARALLEL}
|
||||
|
||||
# Create
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user