metrics fixes

This commit is contained in:
boufni95 2024-11-21 18:20:01 +00:00
parent bdee3426ae
commit de91573f2e
8 changed files with 83 additions and 5 deletions

View file

@ -983,6 +983,9 @@ The nostr server will send back a message response, and inside the body there wi
### LndGetInfoResponse
- __alias__: _string_
- __synced_to_chain__: _boolean_
- __synced_to_graph__: _boolean_
- __watchdog_barking__: _boolean_
### LndMetrics
- __nodes__: ARRAY of: _[LndNodeMetrics](#LndNodeMetrics)_

View file

@ -305,7 +305,10 @@ type LndGetInfoRequest struct {
Nodeid int64 `json:"nodeId"`
}
type LndGetInfoResponse struct {
Alias string `json:"alias"`
Alias string `json:"alias"`
Synced_to_chain bool `json:"synced_to_chain"`
Synced_to_graph bool `json:"synced_to_graph"`
Watchdog_barking bool `json:"watchdog_barking"`
}
type LndMetrics struct {
Nodes []LndNodeMetrics `json:"nodes"`

View file

@ -1730,11 +1730,17 @@ export const LndGetInfoRequestValidate = (o?: LndGetInfoRequest, opts: LndGetInf
export type LndGetInfoResponse = {
alias: string
synced_to_chain: boolean
synced_to_graph: boolean
watchdog_barking: boolean
}
export const LndGetInfoResponseOptionalFields: [] = []
export type LndGetInfoResponseOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
alias_CustomCheck?: (v: string) => boolean
synced_to_chain_CustomCheck?: (v: boolean) => boolean
synced_to_graph_CustomCheck?: (v: boolean) => boolean
watchdog_barking_CustomCheck?: (v: boolean) => boolean
}
export const LndGetInfoResponseValidate = (o?: LndGetInfoResponse, opts: LndGetInfoResponseOptions = {}, path: string = 'LndGetInfoResponse::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
@ -1743,6 +1749,15 @@ export const LndGetInfoResponseValidate = (o?: LndGetInfoResponse, opts: LndGetI
if (typeof o.alias !== 'string') return new Error(`${path}.alias: is not a string`)
if (opts.alias_CustomCheck && !opts.alias_CustomCheck(o.alias)) return new Error(`${path}.alias: custom check failed`)
if (typeof o.synced_to_chain !== 'boolean') return new Error(`${path}.synced_to_chain: is not a boolean`)
if (opts.synced_to_chain_CustomCheck && !opts.synced_to_chain_CustomCheck(o.synced_to_chain)) return new Error(`${path}.synced_to_chain: custom check failed`)
if (typeof o.synced_to_graph !== 'boolean') return new Error(`${path}.synced_to_graph: is not a boolean`)
if (opts.synced_to_graph_CustomCheck && !opts.synced_to_graph_CustomCheck(o.synced_to_graph)) return new Error(`${path}.synced_to_graph: custom check failed`)
if (typeof o.watchdog_barking !== 'boolean') return new Error(`${path}.watchdog_barking: is not a boolean`)
if (opts.watchdog_barking_CustomCheck && !opts.watchdog_barking_CustomCheck(o.watchdog_barking)) return new Error(`${path}.watchdog_barking: custom check failed`)
return null
}

View file

@ -191,6 +191,9 @@ message SetMockInvoiceAsPaidRequest {
message LndGetInfoResponse {
string alias = 1;
bool synced_to_chain = 2;
bool synced_to_graph = 3;
bool watchdog_barking = 4;
}
message BanUserRequest {