diff --git a/README.md b/README.md index e69de29..b40414b 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,3 @@ + +FastDFS java client SDK + diff --git a/src/org/csource/fastdfs/StructBase.java b/src/org/csource/fastdfs/StructBase.java index 1f7ab90..bf29bf5 100644 --- a/src/org/csource/fastdfs/StructBase.java +++ b/src/org/csource/fastdfs/StructBase.java @@ -62,6 +62,11 @@ public abstract class StructBase return (int)ProtoCommon.buff2long(bs, offset + filedInfo.offset); } + protected int int32Value(byte[] bs, int offset, FieldInfo filedInfo) + { + return ProtoCommon.buff2int(bs, offset + filedInfo.offset); + } + protected byte byteValue(byte[] bs, int offset, FieldInfo filedInfo) { return bs[offset + filedInfo.offset]; diff --git a/src/org/csource/fastdfs/StructStorageStat.java b/src/org/csource/fastdfs/StructStorageStat.java index 26975dd..eef3e71 100644 --- a/src/org/csource/fastdfs/StructStorageStat.java +++ b/src/org/csource/fastdfs/StructStorageStat.java @@ -872,6 +872,33 @@ public class StructStorageStat extends StructBase return this.ifTrunkServer; } +/** +* get connection alloc count +* @return connection alloc count +*/ + public int getConnectionAllocCount() + { + return this.connectionAllocCount; + } + +/** +* get connection current count +* @return connection current count +*/ + public int getConnectionCurrentCount() + { + return this.connectionCurrentCount; + } + +/** +* get connection max count +* @return connection max count +*/ + public int getConnectionMaxCount() + { + return this.connectionMaxCount; + } + /** * set fields * @param bs byte array @@ -896,9 +923,9 @@ public class StructStorageStat extends StructBase this.storageHttpPort = intValue(bs, offset, fieldsArray[FIELD_INDEX_STORAGE_HTTP_PORT]); this.currentWritePath = intValue(bs, offset, fieldsArray[FIELD_INDEX_CURRENT_WRITE_PATH]); - this.connectionAllocCount = intValue(bs, offset, fieldsArray[FIELD_INDEX_CONNECTION_ALLOC_COUNT]); - this.connectionCurrentCount = intValue(bs, offset, fieldsArray[FIELD_INDEX_CONNECTION_CURRENT_COUNT]); - this.connectionMaxCount = intValue(bs, offset, fieldsArray[FIELD_INDEX_CONNECTION_MAX_COUNT]); + this.connectionAllocCount = int32Value(bs, offset, fieldsArray[FIELD_INDEX_CONNECTION_ALLOC_COUNT]); + this.connectionCurrentCount = int32Value(bs, offset, fieldsArray[FIELD_INDEX_CONNECTION_CURRENT_COUNT]); + this.connectionMaxCount = int32Value(bs, offset, fieldsArray[FIELD_INDEX_CONNECTION_MAX_COUNT]); this.totalUploadCount = longValue(bs, offset, fieldsArray[FIELD_INDEX_TOTAL_UPLOAD_COUNT]); this.successUploadCount = longValue(bs, offset, fieldsArray[FIELD_INDEX_SUCCESS_UPLOAD_COUNT]); diff --git a/src/org/csource/fastdfs/test/Monitor.java b/src/org/csource/fastdfs/test/Monitor.java index e2d8cff..b3cb257 100644 --- a/src/org/csource/fastdfs/test/Monitor.java +++ b/src/org/csource/fastdfs/test/Monitor.java @@ -118,6 +118,9 @@ public class Monitor System.out.println("\t\tcurrent_write_path = " + storageStat.getCurrentWritePath()); System.out.println("\t\tsource ip_addr = " + storageStat.getSrcIpAddr()); System.out.println("\t\tif_trunk_server = " + storageStat.isTrunkServer()); + System.out.println("\t\tconntion.alloc_count = " + storageStat.getConnectionAllocCount()); + System.out.println("\t\tconntion.current_count = " + storageStat.getConnectionCurrentCount()); + System.out.println("\t\tconntion.max_count = " + storageStat.getConnectionMaxCount()); System.out.println("\t\ttotal_upload_count = " + storageStat.getTotalUploadCount()); System.out.println("\t\tsuccess_upload_count = " + storageStat.getSuccessUploadCount()); System.out.println("\t\ttotal_append_count = " + storageStat.getTotalAppendCount());