• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SpiNNakerManchester / JavaSpiNNaker / 13178749274

06 Feb 2025 12:26PM UTC coverage: 38.613% (+0.02%) from 38.596%
13178749274

push

github

rowleya
Fix started rather than duration

0 of 3 new or added lines in 1 file covered. (0.0%)

77 existing lines in 1 file now uncovered.

9190 of 23800 relevant lines covered (38.61%)

1.16 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/SpiNNaker-allocserv/src/main/java/uk/ac/manchester/spinnaker/alloc/web/Process.java
1
/*
2
 * Copyright (c) 2025 The University of Manchester
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     https://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package uk.ac.manchester.spinnaker.alloc.web;
17

18
import java.time.Duration;
19
import java.time.Instant;
20
import java.time.format.DateTimeFormatter;
21

22
import uk.ac.manchester.spinnaker.messages.model.CPUInfo;
23
import uk.ac.manchester.spinnaker.messages.model.CPUState;
24

25
/** A process in a list of processes. */
26
public class Process {
27

28
        private CPUInfo info;
29

30
        public Process(CPUInfo info) {
×
31
                this.info = info;
×
32
        }
×
33

34
        public int getVirtualId() {
35
                return info.getP();
×
36
        }
37

38
        public int getPhysicalId() {
39
                return info.getPhysicalCPUID();
×
40
        }
41

42
        public String getState() {
43
                return info.getState().name();
×
44
        }
45

46
        public String getApplication() {
47
                return info.getApplicationName();
×
48
        }
49

50
        public String getTime() {
NEW
51
                var instance = Instant.ofEpochSecond(info.getTime());
×
NEW
52
                var formatter = DateTimeFormatter.ofPattern("dd MMM YYYY HH:mm:ss");
×
NEW
53
                return formatter.format(instance);
×
54
        }
55

56
        public boolean isRte() {
57
                return info.getState() == CPUState.RUN_TIME_EXCEPTION;
×
58
        }
59

60
        public String getRteName() {
61
                if (!isRte()) {
×
62
                        return "";
×
63
                }
64
                return info.getRunTimeError().name();
×
65
        }
66

67
        public String getRteRegisters() {
68
                if (!isRte()) {
×
69
                        return "";
×
70
                }
71
                StringBuilder sb = new StringBuilder();
×
72
                var registers = info.getRegisters();
×
73
                for (var r = 0; r < registers.length; r++) {
×
74
                        sb.append(String.format("R%d: %08x ", r, registers[r]));
×
75
                }
76
                return sb.toString();
×
77
        }
78
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc