01: // You can redistribute this software and/or modify it under the terms of
02: // the Ozone Library License version 1 published by ozone-db.org.
03: //
04: // The original code and portions created by SMB are
05: // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
06: //
07: // $Id: ClusterStats.java,v 1.1 2001/12/18 10:31:31 per_nyfelt Exp $
08:
09: package org.ozoneDB.tools;
10:
11: import org.ozoneDB.DxLib.DxObject;
12: import java.io.*;
13:
14: public class ClusterStats extends DxObject {
15: int member = 6;
16: int[] counter = new int[member];
17:
18: public ClusterStats() {
19: for (int i = 0; i < member; i++) {
20: counter[i] = 0;
21: }
22: }
23:
24: public String toString() {
25: return "\nobjects loaded : " + counter[0]
26: + " cluster loaded : " + counter[3]
27: + "\nobjects stored : " + counter[1]
28: + " cluster stored : " + counter[4]
29: + "\nobjects deleted : " + counter[2]
30: + " cluster deleted : " + counter[5];
31: }
32:
33: public void objectLoaded() {
34: counter[0]++;
35: }
36:
37: public void objectStored() {
38: counter[1]++;
39: }
40:
41: public void objectDeleted() {
42: counter[2]++;
43: }
44:
45: public void clusterLoaded() {
46: counter[3]++;
47: }
48:
49: public void clusterStored() {
50: counter[4]++;
51: }
52:
53: public void clusterDeleted() {
54: counter[5]++;
55: }
56:
57: }
|