File tree Expand file tree Collapse file tree 5 files changed +13
-23
lines changed
Expand file tree Collapse file tree 5 files changed +13
-23
lines changed Original file line number Diff line number Diff line change 11/**
2- * @name File correlations
3- * @description
2+ * @name Extraction metrics file data
3+ * @description Extraction metrics and related information for profiling the extraction of individual files.
44 * @kind table
55 * @id js/meta/extraction/file-data
6+ * @tags meta
67 */
78
89import javascript
Original file line number Diff line number Diff line change 11/**
22 * @name File with missing extraction metrics
33 * @description A file missing extraction metrics is indicative of a faulty extractor.
4- * @kind table
5- * @problem.severity error
4+ * @kind problem
5+ * @problem.severity warning
6+ * @precision low
67 * @id js/meta/extraction/missing-metrics
8+ * @tags meta
79 */
810
911import javascript
Original file line number Diff line number Diff line change 33 * @description An overview of how time was spent during extraction
44 * @kind table
55 * @id js/meta/extraction/phase-timings
6+ * @tags meta
67 */
78
89import semmle.javascript.meta.ExtractionMetrics:: ExtractionMetrics
910
10- from PhaseName phaseName , float cpuTime , int cpuPerc
11- where
12- cpuTime = Aggregated:: getCpuTime ( phaseName ) and
13- cpuPerc = ( ( cpuTime / Aggregated:: getCpuTime ( ) ) * 100 ) .floor ( )
14- select phaseName , cpuTime as CPU_NANO , cpuPerc as CPU_PERC
11+ from PhaseName phaseName
12+ select phaseName , Aggregated:: getCpuTime ( phaseName ) as CPU_NANO , Aggregated:: getWallclockTime ( phaseName ) as WALLCLOCK_NANO
Original file line number Diff line number Diff line change @@ -94,7 +94,6 @@ module ExtractionMetrics {
9494 * The name of a phase of the extraction.
9595 */
9696 class PhaseName extends string {
97- bindingset [ this ]
9897 PhaseName ( ) { this = getExtractionPhaseName ( _) }
9998 }
10099
@@ -118,24 +117,14 @@ module ExtractionMetrics {
118117 * Gets the total CPU time spent in phase `phaseName` of the extraction.
119118 */
120119 float getCpuTime ( PhaseName phaseName ) {
121- /* bind */ phaseName = getExtractionPhaseName ( _) and
122120 result = strictsum ( any ( FileWithExtractionMetrics f ) .getCpuTime ( phaseName ) )
123121 }
124122
125123 /**
126124 * Gets the total wallclock time spent in phase `phaseName` of the extraction.
127125 */
128126 float getWallclockTime ( PhaseName phaseName ) {
129- /* bind */ phaseName = getExtractionPhaseName ( _) and
130127 result = strictsum ( any ( FileWithExtractionMetrics f ) .getWallclockTime ( phaseName ) )
131128 }
132129 }
133-
134- /**
135- * Gets `nanoseconds` formatted as a whole number of milliseconds.
136- */
137- bindingset [ nanoSeconds]
138- string formatAsMilliSeconds ( float nanoSeconds ) {
139- result = ( nanoSeconds / ( 1000 * 1000 ) ) .ceil ( ) + ""
140- }
141130}
Original file line number Diff line number Diff line change @@ -1139,7 +1139,7 @@ configLocations(
11391139
11401140/**
11411141 * The time taken for the extraction of a file.
1142- * This table contains non-deternistic content.
1142+ * This table contains non-deterministic content.
11431143 *
11441144 * The sum of the `time` column for each (`file`, `timerKind`) pair
11451145 * is the total time taken for extraction of `file`. The `extractionPhase`
@@ -1149,14 +1149,14 @@ extraction_time(
11491149 int file : @file ref,
11501150 // see `com.semmle.js.extractor.ExtractionMetrics.ExtractionPhase`.
11511151 int extractionPhase: int ref,
1152- // 0 for the elapsed CPU time in nanoseconds, 1 for the wall elapsed wallclock time in nanoseconds
1152+ // 0 for the elapsed CPU time in nanoseconds, 1 for the elapsed wallclock time in nanoseconds
11531153 int timerKind: int ref,
11541154 float time: float ref
11551155)
11561156
11571157/**
11581158 * Non-timing related data for the extraction of a single file.
1159- * This table contains non-deternistic content.
1159+ * This table contains non-deterministic content.
11601160 */
11611161extraction_data(
11621162 int file : @file ref,
You can’t perform that action at this time.
0 commit comments