summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/dnbd3/status/output/ServerStats.java
blob: d464695af608269eb148aff6d64f3435409955c0 (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
package org.openslx.dnbd3.status.output;

import java.util.ArrayList;
import java.util.List;

import org.openslx.dnbd3.status.rpc.Client;
import org.openslx.dnbd3.status.rpc.Image;

import com.google.gson.annotations.Expose;

public class ServerStats implements Cloneable
{

	@Expose
	public String address;
	@Expose
	public int clientCount;
	@Expose
	public int serverCount;
	@Expose
	public long uptime;
	@Expose
	public long bytesSent;
	@Expose
	public long bytesReceived;
	@Expose
	public long timestamp;

	public List<Image> images;

	public List<Client> clients;
	
	@Override
	public ServerStats clone()
	{
		ServerStats n = new ServerStats();
		n.address = this.address;
		n.clientCount = this.clientCount;
		n.serverCount = this.serverCount;
		n.uptime = this.uptime;
		n.bytesSent = this.bytesSent;
		n.bytesReceived = this.bytesReceived;
		n.timestamp = this.timestamp;
		if ( this.images != null ) {
			n.images = new ArrayList<>( this.images );
		}
		if ( this.clients != null ) {
			n.clients = new ArrayList<>( this.clients );
		}
		return n;
	}

}