Skip to main content
summaryrefslogtreecommitdiffstats
blob: 18676d79c2a76912e33a352e143389dd692823ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*******************************************************************************
 * Copyright (c) 2010, 2011 Technical University of Denmark.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Eclipse Public License v1.0 
 * which accompanies this distribution, and is available at 
 * http://www.eclipse.org/legal/epl-v10.html 
 * 
 * Contributors:
 *    Patrick Koenemann, DTU Informatics - initial API and implementation
 *******************************************************************************/
package org.eclipse.emf.compare.mpatch.test.util;

/**
 * Data class for collecting runtime of individual tasks in the framework.
 * 
 * @author Patrick Koenemann (pk@imm.dtu.dk)
 *
 */
public class PerformanceTimes {

	private long built;
	private long emfdiff;
	private long mpatch;
	private long groups;
	private long deps;
	private long resolve;
	private long validate;
	private long copy;
	private long apply;
	private long changes;
	private long check;
	private long refs;

	private long lastTime = System.currentTimeMillis();

	public final void tick() {
		lastTime = System.currentTimeMillis();
	}

	public final long getBuilt() {
		return built;
	}

	public final long getEmfdiff() {
		return emfdiff;
	}

	public final long getMPatch() {
		return mpatch;
	}

	public final long getGroups() {
		return groups;
	}

	public final long getDeps() {
		return deps;
	}

	public final long getRefs() {
		return refs;
	}

	public final long getResolve() {
		return resolve;
	}

	public final long getValidate() {
		return validate;
	}

	public final long getCopy() {
		return copy;
	}

	public final long getApply() {
		return apply;
	}

	public final long getChanges() {
		return changes;
	}

	public final long getCheck() {
		return check;
	}

	public final long getTotal() {
		return built + emfdiff + mpatch + groups + deps + resolve + validate + copy + apply + changes + check;
	}

	private final long getTime() {
		final long currentTime = System.currentTimeMillis();
		final long time = currentTime - lastTime;
		lastTime = currentTime;
		return time;
	}

	public final void setBuilt() {
		this.built = getTime();
	}

	public final void setEmfdiff() {
		this.emfdiff = getTime();
	}

	public final void setMPatch() {
		this.mpatch = getTime();
	}

	public final void setGroups() {
		this.groups = getTime();
	}

	public final void setDeps() {
		this.deps = getTime();
	}

	public final void setResolve() {
		this.resolve = getTime();
	}

	public final void setValidate() {
		this.validate = getTime();
	}

	public final void setCopy() {
		this.copy = getTime();
	}

	public final void setApply() {
		this.apply = getTime();
	}

	public final void setChanges() {
		this.changes = getTime();
	}

	public final void setCheck() {
		this.check = getTime();
	}

	public void setRefs() {
		this.refs = getTime();
	}

}

Back to the top