1 /*
2 * Copyright (c) 2020, Google LLC and others
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Distribution License v. 1.0 which is available at
6 * http://www.eclipse.org/org/documents/edl-v10.php.
7 *
8 * SPDX-License-Identifier: BSD-3-Clause
9 */
10
11 package org.eclipse.jgit.logging;
12
13 /**
14 * Class to register a performance log record.
15 *
16 * @since 5.10
17 */
18 public class PerformanceLogRecord {
19 /** Name of the recorded event. */
20 private String name;
21
22 /** Duration of the recorded event in milliseconds. */
23 private long durationMs;
24
25 /**
26 * Create a new performance log record for an event.
27 *
28 * @param name
29 * name of the event.
30 * @param durationMs
31 * duration in milliseconds of the event.
32 */
33 public PerformanceLogRecord(String name, long durationMs) {
34 this.name = name;
35 this.durationMs = durationMs;
36 }
37
38 /**
39 * Get the name of the recorded event.
40 *
41 * @return name of the recorded event.
42 */
43 public String getName() {
44 return name;
45 }
46
47 /**
48 * Get the duration in milliseconds of the recorded event.
49 *
50 * @return duration in milliseconds of the recorded event.
51 */
52 public long getDurationMs() {
53 return durationMs;
54 }
55 }