forked from lix-project/hydra
4d26546d3c
Builds can now emit metrics that Hydra will store in its database and render as time series via flot charts. Typical applications are to keep track of performance indicators, coverage percentages, artifact sizes, and so on. For example, a coverage build can emit the coverage percentage as follows: echo "lineCoverage $pct %" > $out/nix-support/hydra-metrics Graphs of all metrics for a job can be seen at http://.../job/<project>/<jobset>/<job>#tabs-charts Specific metrics are also visible at http://.../job/<project>/<jobset>/<job>/metric/<metric> The latter URL also allows getting the data in JSON format (e.g. via "curl -H 'Accept: application/json'").
23 lines
863 B
SQL
23 lines
863 B
SQL
create table BuildMetrics (
|
|
build integer not null,
|
|
name text not null,
|
|
|
|
unit text,
|
|
value double precision not null,
|
|
|
|
-- Denormalisation for performance: copy some columns from the
|
|
-- corresponding build.
|
|
project text not null,
|
|
jobset text not null,
|
|
job text not null,
|
|
timestamp integer not null,
|
|
|
|
primary key (build, name),
|
|
foreign key (build) references Builds(id) on delete cascade,
|
|
foreign key (project) references Projects(name) on update cascade,
|
|
foreign key (project, jobset) references Jobsets(project, name) on update cascade,
|
|
foreign key (project, jobset, job) references Jobs(project, jobset, name) on update cascade
|
|
);
|
|
|
|
create index IndexBuildMetricsOnJobTimestamp on BuildMetrics(project, jobset, job, timestamp desc);
|