зеркало из https://github.com/github/codeql.git
A simple query
This commit is contained in:
Родитель
24935c97bc
Коммит
58563744d6
|
@ -210,6 +210,8 @@ module KindPredicatesLog {
|
|||
|
||||
AppearsAs getAppearsAs() { result = this.getObject("appearsAs") }
|
||||
|
||||
int getMillis() { result = this.getNumber("millis") }
|
||||
|
||||
predicate hasCompletionTime(
|
||||
int year, string month, int day, int hours, int minute, int second, int millisecond
|
||||
) {
|
||||
|
@ -228,6 +230,12 @@ module KindPredicatesLog {
|
|||
}
|
||||
|
||||
float getResultSize() { result = this.getFloat("resultSize") }
|
||||
|
||||
override string toString() {
|
||||
if exists(this.getPredicateName())
|
||||
then result = getPredicateName()
|
||||
else result = "<Summary event>"
|
||||
}
|
||||
}
|
||||
|
||||
class SentinelEmpty extends SummaryEvent {
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* Shows a list of the "slow" predicates by wallclock time.
|
||||
*/
|
||||
|
||||
import ql
|
||||
import codeql_ql.StructuredLogs
|
||||
|
||||
int predicateRank(KindPredicatesLog::SummaryEvent evt) {
|
||||
evt =
|
||||
rank[result](KindPredicatesLog::ComputeSimple y, int m | m = y.getMillis() | y order by m desc)
|
||||
}
|
||||
|
||||
from KindPredicatesLog::SummaryEvent evt
|
||||
where predicateRank(evt) < 50
|
||||
select evt, evt.getMillis() as time order by time desc
|
Загрузка…
Ссылка в новой задаче