Skip to content

Commit 8b0ba8b

Browse files
authored
add metric family (#42)
* add metric family the metric set designs do not necessarily map to an explicit type, so I am adding family to allow for better categorization. Signed-off-by: vsoch <vsoch@users.noreply.github.com>
1 parent 85c05a9 commit 8b0ba8b

File tree

18 files changed

+189
-80
lines changed

18 files changed

+189
-80
lines changed

docs/_static/data/metrics.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,79 @@
22
{
33
"name": "app-amg",
44
"description": "parallel algebraic multigrid solver for linear systems arising from problems on unstructured grids",
5+
"family": "simulation",
56
"type": "standalone",
67
"image": "ghcr.io/converged-computing/metric-amg:latest",
78
"url": "https://github.com/LLNL/AMG"
89
},
910
{
1011
"name": "app-kripke",
1112
"description": "parallel algebraic multigrid solver for linear systems arising from problems on unstructured grids",
13+
"family": "simulation",
1214
"type": "standalone",
1315
"image": "ghcr.io/converged-computing/metric-kripke:latest",
1416
"url": "https://github.com/LLNL/Kripke"
1517
},
1618
{
1719
"name": "app-lammps",
1820
"description": "LAMMPS molecular dynamic simulation",
21+
"family": "simulation",
1922
"type": "standalone",
2023
"image": "ghcr.io/converged-computing/metric-lammps:latest",
2124
"url": "https://www.lammps.org/"
2225
},
2326
{
2427
"name": "app-pennant",
2528
"description": "Unstructured mesh hydrodynamics for advanced architectures ",
29+
"family": "simulation",
2630
"type": "standalone",
2731
"image": "ghcr.io/converged-computing/metric-pennant:latest",
2832
"url": "https://github.com/LLNL/pennant"
2933
},
3034
{
3135
"name": "app-quicksilver",
3236
"description": "A proxy app for the Monte Carlo Transport Code",
37+
"family": "simulation",
3338
"type": "standalone",
3439
"image": "ghcr.io/converged-computing/metric-quicksilver:latest",
3540
"url": "https://github.com/LLNL/Quicksilver"
3641
},
3742
{
3843
"name": "io-fio",
3944
"description": "Flexible IO Tester (FIO)",
45+
"family": "storage",
4046
"type": "storage",
4147
"image": "ghcr.io/converged-computing/metric-fio:latest",
4248
"url": "https://fio.readthedocs.io/en/latest/fio_doc.html"
4349
},
4450
{
4551
"name": "io-sysstat",
4652
"description": "statistics for Linux tasks (processes) : I/O, CPU, memory, etc.",
53+
"family": "storage",
4754
"type": "storage",
4855
"image": "ghcr.io/converged-computing/metric-sysstat:latest",
4956
"url": "https://github.com/sysstat/sysstat"
5057
},
5158
{
5259
"name": "network-netmark",
5360
"description": "point to point networking tool",
61+
"family": "network",
5462
"type": "standalone",
5563
"image": "vanessa/netmark:latest",
5664
"url": ""
5765
},
5866
{
5967
"name": "network-osu-benchmark",
6068
"description": "point to point MPI benchmarks",
69+
"family": "network",
6170
"type": "standalone",
6271
"image": "ghcr.io/converged-computing/metric-osu-benchmark:latest",
6372
"url": "https://mvapich.cse.ohio-state.edu/benchmarks/"
6473
},
6574
{
6675
"name": "perf-sysstat",
6776
"description": "statistics for Linux tasks (processes) : I/O, CPU, memory, etc.",
77+
"family": "performance",
6878
"type": "application",
6979
"image": "ghcr.io/converged-computing/metric-sysstat:latest",
7080
"url": "https://github.com/sysstat/sysstat"

docs/_static/data/table.html

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@
416416
<tr>
417417
<th>Name</th>
418418
<th>Type</th>
419+
<th>Family</th>
419420
<th>Description</th>
420421
<th>Container</th>
421422
</tr>
@@ -440,6 +441,7 @@
440441
return "<a href='" + row['url'] + "' target='_blank'>" + data +"</a>";},
441442
},
442443
{ data: "type"},
444+
{ data: "family"},
443445
{ data: "description"},
444446
{ data: "image",
445447
render: function ( data, type, row ) {
@@ -453,14 +455,18 @@
453455
}}
454456
],
455457
'rowCallback': function(row, data, index){
456-
if(data.type == 'storage'){
457-
$(row).find('td:eq(1)').css('background-color', '#f5f580'); // yellow
458+
// Distinguish family
459+
if(data.family == 'storage'){
460+
$(row).find('td:eq(2)').css('background-color', 'lavender');
458461
}
459-
if(data.type == 'standalone'){
460-
$(row).find('td:eq(1)').css('background-color', '#f79fb7'); // pinkish
462+
if(data.family == 'performance'){
463+
$(row).find('td:eq(2)').css('background-color', '#f79fb7');
461464
}
462-
if(data.type == 'application'){
463-
$(row).find('td:eq(1)').css('background-color', '#8af98a'); // lime green
465+
if(data.family == 'network'){
466+
$(row).find('td:eq(2)').css('background-color', 'orange');
467+
}
468+
if(data.family == 'simulation'){
469+
$(row).find('td:eq(2)').css('background-color', 'skyblue');
464470
}
465471
}
466472
});

docs/getting_started/metrics.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ The following metrics are under development (or being planned).
77
- [Application Metrics](https://converged-computing.github.io/metrics-operator/getting_started/metrics.html#application)
88
- [Standalone Metrics](https://converged-computing.github.io/metrics-operator/getting_started/metrics.html#standalone)
99

10-
<iframe src="../_static/data/table.html" style="width:100%; height:700px;" frameBorder="0"></iframe>
10+
Each of the above is a metric design, which is primarily represented in the Metrics Operator code. However, within each design
11+
there are different families of metrics (e.g., storage, network, performance, simulation) shown in the table below as the "Family" column.
12+
We likely will tweak and improve upon these categories.
13+
14+
<iframe src="../_static/data/table.html" style="width:100%; height:800px;" frameBorder="0"></iframe>
1115

1216
All metrics can be customized with the following variables
1317

@@ -18,7 +22,8 @@ All metrics can be customized with the following variables
1822

1923
## Implemented Metrics
2024

21-
Each metric has a link to the type, along with (optionally) examples.
25+
Each metric has a link to the type, along with (optionally) examples. These sections will better be organized by
26+
family once we decide on a more final set.
2227

2328
### Performance
2429

hack/docs-gen/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package main
22

33
import (
44
"encoding/json"
5-
"io/ioutil"
65
"log"
76
"os"
87
"sort"
@@ -23,6 +22,7 @@ var (
2322
type MetricOutput struct {
2423
Name string `json:"name"`
2524
Description string `json:"description"`
25+
Family string `json:"family"`
2626
Type string `json:"type"`
2727
Image string `json:"image"`
2828
Url string `json:"url"`
@@ -38,6 +38,7 @@ func main() {
3838
newRecord := MetricOutput{
3939
Name: metric.Name(),
4040
Description: metric.Description(),
41+
Family: metric.Family(),
4142
Type: metric.Type(),
4243
Image: metric.Image(),
4344
Url: metric.Url(),
@@ -54,7 +55,7 @@ func main() {
5455
if err != nil {
5556
log.Fatalf("Could not marshall records %s\n", err.Error())
5657
}
57-
err = ioutil.WriteFile(filename, file, 0644)
58+
err = os.WriteFile(filename, file, 0644)
5859
if err != nil {
5960
log.Fatalf("Could not write to file %s: %s\n", filename, err.Error())
6061
}

pkg/jobs/application.go

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
Copyright 2023 Lawrence Livermore National Security, LLC
3+
(c.f. AUTHORS, NOTICE.LLNS, COPYING)
4+
5+
SPDX-License-Identifier: MIT
6+
*/
7+
8+
package jobs
9+
10+
import (
11+
api "github.com/converged-computing/metrics-operator/api/v1alpha1"
12+
metrics "github.com/converged-computing/metrics-operator/pkg/metrics"
13+
"k8s.io/apimachinery/pkg/util/intstr"
14+
jobset "sigs.k8s.io/jobset/api/jobset/v1alpha2"
15+
)
16+
17+
// These are common templates for application metrics
18+
19+
// SingleApplication is a Metric base for a simple application metric
20+
// be accessible by other packages (and not conflict with function names)
21+
type SingleApplication struct {
22+
Identifier string
23+
Rate int32
24+
Summary string
25+
Completions int32
26+
Container string
27+
Workdir string
28+
ResourceSpec *api.ContainerResources
29+
AttributeSpec *api.ContainerSpec
30+
}
31+
32+
// Name returns the metric name
33+
func (m SingleApplication) Name() string {
34+
return m.Identifier
35+
}
36+
37+
// Description returns the metric description
38+
func (m SingleApplication) Description() string {
39+
return m.Summary
40+
}
41+
42+
// Default SingleApplication is generic performance family
43+
func (m SingleApplication) Family() string {
44+
return metrics.PerformanceFamily
45+
}
46+
47+
// Return container resources for the metric container
48+
func (m SingleApplication) Resources() *api.ContainerResources {
49+
return m.ResourceSpec
50+
}
51+
func (m SingleApplication) Attributes() *api.ContainerSpec {
52+
return m.AttributeSpec
53+
}
54+
55+
// Validation
56+
func (m SingleApplication) Validate(spec *api.MetricSet) bool {
57+
return true
58+
}
59+
60+
// Container variables
61+
func (m SingleApplication) Image() string {
62+
return m.Container
63+
}
64+
func (m SingleApplication) WorkingDir() string {
65+
return m.Workdir
66+
}
67+
68+
func (m SingleApplication) ReplicatedJobs(spec *api.MetricSet) ([]jobset.ReplicatedJob, error) {
69+
return []jobset.ReplicatedJob{}, nil
70+
}
71+
72+
func (m SingleApplication) ListOptions() map[string][]intstr.IntOrString {
73+
return map[string][]intstr.IntOrString{}
74+
}
75+
76+
func (m SingleApplication) SuccessJobs() []string {
77+
return []string{}
78+
}
79+
80+
func (m SingleApplication) Type() string {
81+
return metrics.ApplicationMetric
82+
}

pkg/jobs/launcher.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ func (m LauncherWorker) Description() string {
5959
return m.Summary
6060
}
6161

62+
// Family returns a generic performance family
63+
func (m LauncherWorker) Family() string {
64+
return metrics.PerformanceFamily
65+
}
66+
6267
// Jobs required for success condition (n is the LauncherWorker run)
6368
func (m *LauncherWorker) SuccessJobs() []string {
6469
m.ensureDefaultNames()

pkg/jobs/storage.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ func (m StorageGeneric) Name() string {
3535
return m.Identifier
3636
}
3737

38+
// Family returns the storage family
39+
func (m StorageGeneric) Family() string {
40+
return metrics.StorageFamily
41+
}
42+
3843
// Description returns the metric description
3944
func (m StorageGeneric) Description() string {
4045
return m.Summary

pkg/metrics/app/amg.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ func (m AMG) Url() string {
3131
return "https://github.com/LLNL/AMG"
3232
}
3333

34+
// I think this is a simulation?
35+
func (m AMG) Family() string {
36+
return metrics.SimulationFamily
37+
}
38+
3439
// Set custom options / attributes for the metric
3540
func (m *AMG) SetOptions(metric *api.Metric) {
3641
m.Rate = metric.Rate

pkg/metrics/app/kripke.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ func (m Kripke) Url() string {
2929
return "https://github.com/LLNL/Kripke"
3030
}
3131

32+
// I think this is a simulation?
33+
func (m Kripke) Family() string {
34+
return metrics.SimulationFamily
35+
}
36+
3237
// Set custom options / attributes for the metric
3338
func (m *Kripke) SetOptions(metric *api.Metric) {
3439
m.Rate = metric.Rate

pkg/metrics/app/lammps.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ func (m Lammps) Url() string {
2828
return "https://www.lammps.org/"
2929
}
3030

31+
// I think this is a simulation?
32+
func (m Lammps) Family() string {
33+
return metrics.SimulationFamily
34+
}
35+
3136
// Set custom options / attributes for the metric
3237
func (m *Lammps) SetOptions(metric *api.Metric) {
3338
m.Rate = metric.Rate

0 commit comments

Comments
 (0)