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

SpiNNakerManchester / JavaSpiNNaker / 13182280721

06 Feb 2025 03:33PM UTC coverage: 38.533% (-0.1%) from 38.647%
13182280721

Pull #1219

github

rowleya
Fix some more errors
Pull Request #1219: Process listing

0 of 57 new or added lines in 3 files covered. (0.0%)

8 existing lines in 4 files now uncovered.

9172 of 23803 relevant lines covered (38.53%)

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.text.SimpleDateFormat;
19
import java.time.Instant;
20
import java.util.Date;
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

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

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

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

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

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

50
        public int getAppId() {
NEW
51
                return info.getApplicationID();
×
52
        }
53

54
        public String getStart() {
NEW
55
                var instant = Instant.ofEpochSecond(info.getTime());
×
NEW
56
                var date = Date.from(instant);
×
NEW
57
                var formatter = new SimpleDateFormat("dd MMM yyyy HH:mm:ss");
×
NEW
58
                return formatter.format(date);
×
59
        }
60

61
        public boolean isRte() {
NEW
62
                return info.getState() == CPUState.RUN_TIME_EXCEPTION;
×
63
        }
64

65
        public String getRteName() {
NEW
66
                if (!isRte()) {
×
NEW
67
                        return "";
×
68
                }
NEW
69
                return info.getRunTimeError().name();
×
70
        }
71

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