[reporting] add additional fields to AnalysisStats event

Summary:
- Add 2 fields to AnalysisStats event type:
	- lang
	- clang_method_kind
- depends on previous diff

Reviewed By: dulmarod

Differential Revision: D6871453

fbshipit-source-id: 4f211f3
master
Varun Arora 7 years ago committed by Facebook Github Bot
parent ad10435b58
commit 97c36448b6

@ -35,6 +35,21 @@ type clang_method_kind =
let clang_method_kind_equal = [%compare.equal : clang_method_kind]
let string_of_clang_method_kind = function
| CPP_INSTANCE ->
"CPP_INSTANCE"
| OBJC_INSTANCE ->
"OBJC_INSTANCE"
| CPP_CLASS ->
"CPP_CLASS"
| OBJC_CLASS ->
"OBJC_CLASS"
| BLOCK ->
"BLOCK"
| C_FUNCTION ->
"C_FUNCTION"
(** Type for ObjC accessors *)
type objc_accessor_type =
| Objc_getter of Typ.Struct.field

@ -25,6 +25,8 @@ type clang_method_kind =
val clang_method_kind_equal : clang_method_kind -> clang_method_kind -> bool
val string_of_clang_method_kind : clang_method_kind -> string
type objc_accessor_type =
| Objc_getter of Typ.Struct.field
| Objc_setter of Typ.Struct.field

@ -552,6 +552,10 @@ module Stats = struct
; analysis_total_nodes= Specs.get_proc_desc summary |> Procdesc.get_nodes_num
; symops= summary.stats.symops
; method_location= Specs.get_loc summary
; lang=
Specs.get_proc_name summary |> Typ.Procname.get_language
|> Language.to_explicit_string
; clang_method_kind= (Specs.get_attributes summary).clang_method_kind
; analysis_status= summary.stats.stats_failure
; method_name= Specs.get_proc_name summary |> Typ.Procname.to_string }
:: stats.events_to_log

@ -130,6 +130,8 @@ type analysis_stats =
; analysis_total_nodes: int
; symops: int
; method_location: Location.t
; lang: string
; clang_method_kind: ProcAttributes.clang_method_kind
; analysis_status: SymOp.failure_kind option
; method_name: string }
@ -146,6 +148,9 @@ let create_analysis_stats_row base record =
[ string_of_int record.method_location.line
; ":"
; string_of_int record.method_location.col ])
|> add_string ~key:"lang" ~data:record.lang
|> add_string ~key:"clang_method_kind"
~data:(ProcAttributes.string_of_clang_method_kind record.clang_method_kind)
|> add_string ~key:"analysis_status"
~data:
(Option.value_map record.analysis_status ~default:"OK" ~f:(fun stats_failure ->

@ -28,6 +28,8 @@ type analysis_stats =
; analysis_total_nodes: int
; symops: int
; method_location: Location.t
; lang: string
; clang_method_kind: ProcAttributes.clang_method_kind
; analysis_status: SymOp.failure_kind option
; method_name: string }

@ -16,6 +16,8 @@ let language_to_string = [(Clang, "C/C++/ObjC"); (Java, "Java"); (Python, "pytho
let to_string lang = List.Assoc.find_exn language_to_string ~equal lang
let to_explicit_string = function Clang -> "Clang" | Java -> "Java" | Python -> "Python"
let of_string s = List.Assoc.find (List.Assoc.inverse language_to_string) ~equal:String.equal s
(** Current language *)

@ -15,6 +15,8 @@ val equal : t -> t -> bool
val to_string : t -> string
val to_explicit_string : t -> string
val of_string : string -> t option
val curr_language : t ref

Loading…
Cancel
Save