Skip to content

Instantly share code, notes, and snippets.

View bhathiya's full-sized avatar

Bhathiya Jayasekara bhathiya

View GitHub Profile
SELECT
IFNULL(B.engine,'Total') "Storage Engine",
CONCAT(FORMAT(B.DSize/POWER(1024,pw),3),' ', SUBSTR(' KMGTP',pw+1,1),'B') "Data Size",
CONCAT(FORMAT(B.ISize/POWER(1024,pw),3),' ', SUBSTR(' KMGTP',pw+1,1),'B') "Index Size",
CONCAT(FORMAT(B.TSize/POWER(1024,pw),3),' ', SUBSTR(' KMGTP',pw+1,1),'B') "Table Size"
FROM (
SELECT
engine,
SUM(data_length) DSize,
SUM(index_length) ISize,
SELECT
table_schema "DATABASE_NAME",
(sum( data_length + index_length ) / 1024 / 1024) "DISK_USAGE",
(sum(data_free)/ 1024 / 1024) "FREE_SPACE"
FROM information_schema.TABLES
GROUP BY table_schema;
show status;
show global status;
select * from (SELECT sum(total_table_meg)over (partition by owner) as DISK_USAGE, realsize FROM (
SELECT
owner, object_name, object_type, table_name, ROUND(bytes)/1024/1024 AS meg,bytes/1024/1024 as realSize,
tablespace_name, extents, initial_extent,
Sum(bytes/1024/1024) OVER (PARTITION BY table_name) AS total_table_meg
FROM (
-- Tables
SELECT owner, segment_name AS object_name, 'TABLE' AS object_type,
segment_name AS table_name, bytes,
tablespace_name, extents, initial_extent
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="${carbon.home}/repository/logs"
prefix="localhost_access_log_test."
suffix=".log"
pattern="%{Content-Type}i %{Accept}i %{Accept-Encoding}i"
resolveHosts="false"/>
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="${carbon.home}/repository/logs"
prefix="localhost_access_log_test."
suffix=".log"
pattern="%{Content-Type}o %{Content-Length}o %{Date}o %{Server}o"
resolveHosts="false"/>
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="${carbon.home}/repository/logs"
prefix="localhost_access_log_test."
suffix=".log"
pattern="%r %q %h"
resolveHosts="false"/>
<Valve className="org.apache.catalina.valves.ExtendedAccessLogValve"
directory="${carbon.home}/repository/logs"
prefix="localhost_access_log_extended."
suffix=".log"
pattern="x-P(param1) x-P(param2)"
resolveHosts="false"/>
package org.wso2.cassandra.statistics;
import org.apache.cassandra.db.ColumnFamilyStoreMBean;
import javax.management.JMX;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import java.io.IOException;