From addf415c8aa429bc066f0f7a9e56fae0c4832f4f Mon Sep 17 00:00:00 2001 From: Jason Tatton Date: Tue, 1 Aug 2023 18:23:00 -0700 Subject: [PATCH] Back out "Immediate flush of ERRPY telemetry" Summary: This change backs out the change to more quickly flush ERRPY telemetry. Note that this does not fix the underlying bug which this change had surfaced, but landing this diff will mean that if we upgrade the pyre server used by codenav (accidentally or deliberately as in D47814753), codenav won't start failing at an unacceptable rate as it was before again. Reviewed By: grievejia Differential Revision: D47973365 fbshipit-source-id: 9ffae92bedd5fc0d867d63c46cb5dd459ba7af04 --- source/analysis/astEnvironment.ml | 3 ++- source/statistics.ml | 4 ++-- source/statistics.mli | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/analysis/astEnvironment.ml b/source/analysis/astEnvironment.ml index 8fa92d661ab..1a5be1c1946 100644 --- a/source/analysis/astEnvironment.ml +++ b/source/analysis/astEnvironment.ml @@ -384,11 +384,12 @@ module FromReadOnlyUpstream = struct error recovery for the purposes of error recovery quality management *) ["raw_code", raw_code]) in - Statistics.errpy_call ~name:"ok" ~timer ~integers ~normals () + Statistics.errpy_call ~flush:false ~name:"ok" ~timer ~integers ~normals () in let log_errpy_error ~error_string = Statistics.errpy_call + ~flush:true ~name:"error" ~timer ~integers:[] diff --git a/source/statistics.ml b/source/statistics.ml index 3d058fc8486..f2ecc4928c1 100644 --- a/source/statistics.ml +++ b/source/statistics.ml @@ -251,7 +251,7 @@ let event sample ~integers ~normals:(("name", name) :: normals) () |> log ~flush "perfpipe_pyre_events" -let errpy_call ~name ~timer ~integers ~normals () = +let errpy_call ~flush ~name ~timer ~integers ~normals () = let time_in_seconds = Timer.stop_in_sec timer in let integer_time_in_microseconds = time_in_seconds *. 1e6 |> Int.of_float in @@ -259,7 +259,7 @@ let errpy_call ~name ~timer ~integers ~normals () = let normals = ("name", name) :: normals in Log.log ~section:`Errpy "%s%s" (String.capitalize name) (format_as_text ~integers ~normals ()); - sample ~integers ~normals () |> log ~flush:true "perfpipe_errpy_calls" + sample ~integers ~normals () |> log ~flush "perfpipe_errpy_calls" let log_model_query_outputs diff --git a/source/statistics.mli b/source/statistics.mli index ad4439d209b..e23b632bf11 100644 --- a/source/statistics.mli +++ b/source/statistics.mli @@ -76,7 +76,8 @@ val buck_event val log_worker_exception : pid:int -> origin:string -> Unix.process_status -> unit val errpy_call - : name:string -> + : flush:bool -> + name:string -> timer:Timer.t -> integers:(string * int) list -> normals:(string * string) list ->