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

SpiNNakerManchester / JavaSpiNNaker / 13179387573

06 Feb 2025 01:02PM UTC coverage: 38.607% (+0.02%) from 38.585%
13179387573

push

github

rowleya
Add APP Id

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

13 existing lines in 1 file now uncovered.

9190 of 23804 relevant lines covered (38.61%)

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.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

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

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

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

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

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

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

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

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

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

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