Skip to content

Commit

Permalink
Filter by structured_event_id
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmr1993 committed Jun 6, 2023
1 parent bcc5ea3 commit b4c598c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
14 changes: 11 additions & 3 deletions graphql_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2039,9 +2039,17 @@
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
}
},
"defaultValue": null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ module Node = struct
module StartFilteredLog =
[%graphql
{|
mutation ($filter: String!) @encoders(module: "Encoders"){
mutation ($filter: [String!]!) @encoders(module: "Encoders"){
startFilteredLog(filter: $filter)
}
|}]
Expand Down
4 changes: 2 additions & 2 deletions src/lib/mina_graphql/mina_graphql.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2868,10 +2868,10 @@ module Mutations = struct

let start_filtered_log =
field "startFilteredLog" ~doc:"TODO" ~typ:(non_null string)
~args:Arg.[ arg "filter" ~typ:(non_null string) ]
~args:Arg.[ arg "filter" ~typ:(non_null (list (non_null string))) ]
~resolve:(fun { ctx = t; _ } () filter ->
Mina_lib.start_filtered_log t filter ;
filter )
"ok" )

let create_account =
io_field "createAccount"
Expand Down
7 changes: 5 additions & 2 deletions src/lib/mina_lib/mina_lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2033,15 +2033,18 @@ let runtime_config { config = { precomputed_values; _ }; _ } =

let start_filtered_log
({ in_memory_reverse_structured_log_messages_for_integration_test; _ } : t)
(_ : string) =
(structured_log_ids : string list) =
let handle str =
let idx, old_messages =
!in_memory_reverse_structured_log_messages_for_integration_test
in
in_memory_reverse_structured_log_messages_for_integration_test :=
(idx + 1, str :: old_messages)
in
let event_set = (* TODO *) Structured_log_events.Set.empty in
let event_set =
Structured_log_events.Set.of_list
@@ List.map ~f:Structured_log_events.id_of_string structured_log_ids
in
Logger.Consumer_registry.register ~id:Logger.Logger_id.mina
~processor:(Logger.Processor.raw_structured_log_events event_set)
~transport:(Logger.Transport.raw handle)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/mina_lib/mina_lib.mli
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,6 @@ val net : t -> Mina_networking.t

val runtime_config : t -> Runtime_config.t

val start_filtered_log : t -> string -> unit
val start_filtered_log : t -> string list -> unit

val get_filtered_log_entries : t -> int -> string list

0 comments on commit b4c598c

Please sign in to comment.