src/java/org/apache/cassandra/tools/NodeCmd.java
/**
     * Write node information.
     * 
     * @param outs the stream to write to
     */
Write node information.

@param outs the stream to write to
Write node information . @param outs the stream to write to
public void printInfo(PrintStream outs)
    {
        boolean gossipInitialized = probe.isInitialized();
        outs.printf("%-17s: %s%n", "Token", probe.getToken());
        outs.printf("%-17s: %s%n", "Gossip active", gossipInitialized);
        outs.printf("%-17s: %s%n", "Load", probe.getLoadString());
        if (gossipInitialized)
            outs.printf("%-17s: %s%n", "Generation No", probe.getCurrentGenerationNumber());
        else
            outs.printf("%-17s: %s%n", "Generation No", 0);
        long secondsUp = probe.getUptime() / 1000;
        outs.printf("%-17s: %d%n", "Uptime (seconds)", secondsUp);
        MemoryUsage heapUsage = probe.getHeapMemoryUsage();
        double memUsed = (double)heapUsage.getUsed() / (1024 * 1024);
        double memMax = (double)heapUsage.getMax() / (1024 * 1024);
        outs.printf("%-17s: %.2f / %.2f%n", "Heap Memory (MB)", memUsed, memMax);
        outs.printf("%-17s: %s%n", "Data Center", probe.getDataCenter());
        outs.printf("%-17s: %s%n", "Rack", probe.getRack());
        outs.printf("%-17s: %s%n", "Exceptions", probe.getExceptionCount());
        CacheServiceMBean cacheService = probe.getCacheServiceMBean();
        outs.printf("%-17s: size %d (bytes), capacity %d (bytes), %d hits, %d requests, %.3f recent hit rate, %d save period in seconds%n",
                    "Key Cache",
                    cacheService.getKeyCacheSize(),
                    cacheService.getKeyCacheCapacityInBytes(),
                    cacheService.getKeyCacheHits(),
                    cacheService.getKeyCacheRequests(),
                    cacheService.getKeyCacheRecentHitRate(),
                    cacheService.getKeyCacheSavePeriodInSeconds());
        outs.printf("%-17s: size %d (bytes), capacity %d (bytes), %d hits, %d requests, %.3f recent hit rate, %d save period in seconds%n",
                    "Row Cache",
                    cacheService.getRowCacheSize(),
                    cacheService.getRowCacheCapacityInBytes(),
                    cacheService.getRowCacheHits(),
                    cacheService.getRowCacheRequests(),
                    cacheService.getRowCacheRecentHitRate(),
                    cacheService.getRowCacheSavePeriodInSeconds());
    }
public void printInfo ( PrintStream outs ) { boolean gossipInitialized = probe . isInitialized ( ) ; outs . printf ( "%-17s: %s%n" , "Token" , probe . getToken ( ) ) ; outs . printf ( "%-17s: %s%n" , "Gossip active" , gossipInitialized ) ; outs . printf ( "%-17s: %s%n" , "Load" , probe . getLoadString ( ) ) ; if ( gossipInitialized ) outs . printf ( "%-17s: %s%n" , "Generation No" , probe . getCurrentGenerationNumber ( ) ) ; else outs . printf ( "%-17s: %s%n" , "Generation No" , 0 ) ; long secondsUp = probe . getUptime ( ) / 1000 ; outs . printf ( "%-17s: %d%n" , "Uptime (seconds)" , secondsUp ) ; MemoryUsage heapUsage = probe . getHeapMemoryUsage ( ) ; double memUsed = ( double ) heapUsage . getUsed ( ) / ( 1024 * 1024 ) ; double memMax = ( double ) heapUsage . getMax ( ) / ( 1024 * 1024 ) ; outs . printf ( "%-17s: %.2f / %.2f%n" , "Heap Memory (MB)" , memUsed , memMax ) ; outs . printf ( "%-17s: %s%n" , "Data Center" , probe . getDataCenter ( ) ) ; outs . printf ( "%-17s: %s%n" , "Rack" , probe . getRack ( ) ) ; outs . printf ( "%-17s: %s%n" , "Exceptions" , probe . getExceptionCount ( ) ) ; CacheServiceMBean cacheService = probe . getCacheServiceMBean ( ) ; outs . printf ( "%-17s: size %d (bytes), capacity %d (bytes), %d hits, %d requests, %.3f recent hit rate, %d save period in seconds%n" , "Key Cache" , cacheService . getKeyCacheSize ( ) , cacheService . getKeyCacheCapacityInBytes ( ) , cacheService . getKeyCacheHits ( ) , cacheService . getKeyCacheRequests ( ) , cacheService . getKeyCacheRecentHitRate ( ) , cacheService . getKeyCacheSavePeriodInSeconds ( ) ) ; outs . printf ( "%-17s: size %d (bytes), capacity %d (bytes), %d hits, %d requests, %.3f recent hit rate, %d save period in seconds%n" , "Row Cache" , cacheService . getRowCacheSize ( ) , cacheService . getRowCacheCapacityInBytes ( ) , cacheService . getRowCacheHits ( ) , cacheService . getRowCacheRequests ( ) , cacheService . getRowCacheRecentHitRate ( ) , cacheService . getRowCacheSavePeriodInSeconds ( ) ) ; }
Write node information.
Write node information .
// Uptime // Memory usage // Data Center/Rack // Exceptions // Key Cache: Hits, Requests, RecentHitRate, SavePeriodInSeconds // Row Cache: Hits, Requests, RecentHitRate, SavePeriodInSeconds