EMMA Coverage Report (generated Mon Oct 17 05:41:20 EDT 2011)
[all classes][org.jclouds.elasticstack.domain]

COVERAGE SUMMARY FOR SOURCE FILE [DriveMetrics.java]

nameclass, %method, %block, %line, %
DriveMetrics.java100% (2/2)64%  (9/14)74%  (147/200)73%  (32/44)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DriveMetrics100% (1/1)38%  (3/8)68%  (112/165)65%  (22/34)
getReadBytes (): long 0%   (0/1)0%   (0/3)0%   (0/1)
getReadRequests (): long 0%   (0/1)0%   (0/3)0%   (0/1)
getWriteBytes (): long 0%   (0/1)0%   (0/3)0%   (0/1)
getWriteRequests (): long 0%   (0/1)0%   (0/3)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/27)0%   (0/1)
equals (Object): boolean 100% (1/1)74%  (39/53)56%  (9/16)
DriveMetrics (long, long, long, long): void 100% (1/1)100% (15/15)100% (6/6)
hashCode (): int 100% (1/1)100% (58/58)100% (7/7)
     
class DriveMetrics$Builder100% (1/1)100% (6/6)100% (35/35)100% (10/10)
DriveMetrics$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
build (): DriveMetrics 100% (1/1)100% (12/12)100% (1/1)
readBytes (long): DriveMetrics$Builder 100% (1/1)100% (5/5)100% (2/2)
readRequests (long): DriveMetrics$Builder 100% (1/1)100% (5/5)100% (2/2)
writeBytes (long): DriveMetrics$Builder 100% (1/1)100% (5/5)100% (2/2)
writeRequests (long): DriveMetrics$Builder 100% (1/1)100% (5/5)100% (2/2)

1/**
2 * Licensed to jclouds, Inc. (jclouds) under one or more
3 * contributor license agreements.  See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership.  jclouds licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License.  You may obtain a copy of the License at
9 *
10 *   http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied.  See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19package org.jclouds.elasticstack.domain;
20 
21 
22/**
23 * 
24 * @author Adrian Cole
25 */
26public class DriveMetrics {
27   public static class Builder {
28      protected long readBytes;
29      protected long readRequests;
30      protected long writeBytes;
31      protected long writeRequests;
32 
33      public Builder readBytes(long readBytes) {
34         this.readBytes = readBytes;
35         return this;
36      }
37 
38      public Builder readRequests(long readRequests) {
39         this.readRequests = readRequests;
40         return this;
41      }
42 
43      public Builder writeBytes(long writeBytes) {
44         this.writeBytes = writeBytes;
45         return this;
46      }
47 
48      public Builder writeRequests(long writeRequests) {
49         this.writeRequests = writeRequests;
50         return this;
51      }
52 
53      public DriveMetrics build() {
54         return new DriveMetrics(readBytes, readRequests, writeBytes, writeRequests);
55      }
56   }
57 
58   protected final long readBytes;
59   protected final long readRequests;
60   protected final long writeBytes;
61   protected final long writeRequests;
62 
63   public DriveMetrics(long readBytes, long readRequests, long writeBytes, long writeRequests) {
64      this.readBytes = readBytes;
65      this.readRequests = readRequests;
66      this.writeBytes = writeBytes;
67      this.writeRequests = writeRequests;
68   }
69 
70   /**
71    * 
72    * @return Cumulative i/o byte/request count for each drive
73    */
74   public long getReadBytes() {
75      return readBytes;
76   }
77 
78   /**
79    * 
80    * @return Cumulative i/o byte/request count for each drive
81    */
82   public long getReadRequests() {
83      return readRequests;
84   }
85 
86   /**
87    * 
88    * @return Cumulative i/o byte/request count for each drive
89    */
90   public long getWriteBytes() {
91      return writeBytes;
92   }
93 
94   /**
95    * 
96    * @return Cumulative i/o byte/request count for each drive
97    */
98   public long getWriteRequests() {
99      return writeRequests;
100   }
101 
102   @Override
103   public int hashCode() {
104      final int prime = 31;
105      int result = 1;
106      result = prime * result + (int) (readBytes ^ (readBytes >>> 32));
107      result = prime * result + (int) (readRequests ^ (readRequests >>> 32));
108      result = prime * result + (int) (writeBytes ^ (writeBytes >>> 32));
109      result = prime * result + (int) (writeRequests ^ (writeRequests >>> 32));
110      return result;
111   }
112 
113   @Override
114   public boolean equals(Object obj) {
115      if (this == obj)
116         return true;
117      if (obj == null)
118         return false;
119      if (getClass() != obj.getClass())
120         return false;
121      DriveMetrics other = (DriveMetrics) obj;
122      if (readBytes != other.readBytes)
123         return false;
124      if (readRequests != other.readRequests)
125         return false;
126      if (writeBytes != other.writeBytes)
127         return false;
128      if (writeRequests != other.writeRequests)
129         return false;
130      return true;
131   }
132 
133   @Override
134   public String toString() {
135      return "[readBytes=" + readBytes + ", readRequests=" + readRequests + ", writeBytes=" + writeBytes
136            + ", writeRequests=" + writeRequests + "]";
137   }
138}

[all classes][org.jclouds.elasticstack.domain]
EMMA 2.0.5312 (C) Vladimir Roubtsov