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

SpiNNakerManchester / JavaSpiNNaker / 13179150406

06 Feb 2025 12:49PM UTC coverage: 38.585% (-0.03%) from 38.613%
13179150406

push

github

rowleya
Fix the object too

9184 of 23802 relevant lines covered (38.58%)

1.15 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.Instant;
19
import java.time.format.DateTimeFormatter;
20

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

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

27
        private CPUInfo info;
28

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

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

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

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

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

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

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

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

66
        public String getRteRegisters() {
67
                if (!isRte()) {
×
68
                        return "";
×
69
                }
70
                StringBuilder sb = new StringBuilder();
×
71
                var registers = info.getRegisters();
×
72
                for (var r = 0; r < registers.length; r++) {
×
73
                        sb.append(String.format("R%d: %08x ", r, registers[r]));
×
74
                }
75
                return sb.toString();
×
76
        }
77
}
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