Permalink
Browse files

update sql

  • Loading branch information...
shaocongcong committed Jan 23, 2019
1 parent 6b5441e commit ef6a81c9790421f71114555016eba06ea0a1df0d
BIN +0 Bytes (100%) .DS_Store
Binary file not shown.
@@ -4,8 +4,8 @@ common:
admintoken: "vgo.io"

agent:
# vgoaddr: "10.77.0.125:8081"
vgoaddr: "127.0.0.1:8081"
vgoaddr: "10.50.50.36:8081"
# vgoaddr: "127.0.0.1:8081"
keepliveinterval: 3
useenv: false
env: "APM_TEST"
@@ -9,8 +9,8 @@ analyze:

cassandra:
cluster:
- "127.0.0.1:9042"
# - "10.100.7.46:9042"
# - "127.0.0.1:9042"
- "10.100.7.46:9042"
# - "10.50.24.201:9042"
keyspace: "vgo_v1_datacenter"
numconns: 3
@@ -28,8 +28,8 @@ etcd:
- "10.7.24.191:2379"
- "10.7.24.192:2379"
dltimeout: 10
reportdir: "/analyze1"
watchdir: "/analyze1"
reportdir: "/analyze"
watchdir: "/analyze"
reporttime: 10
ttl: 10

@@ -42,7 +42,7 @@ func (spanEvents *SpanEvents) eventsCounter(rpc string, events []*trace.TSpanEve
api.errCount++
}

api.averageElapsed = api.elapsed / api.count
api.averageElapsed = float64(api.elapsed) / float64(api.count)
}

for _, event := range chunkEvents {
@@ -68,7 +68,7 @@ func (spanEvents *SpanEvents) eventsCounter(rpc string, events []*trace.TSpanEve
api.errCount++
}

api.averageElapsed = api.elapsed / api.count
api.averageElapsed = float64(api.elapsed) / float64(api.count)
}

return nil
@@ -111,7 +111,7 @@ type SpanEvent struct {
elapsed int
maxElapsed int
minElapsed int
averageElapsed int
averageElapsed float64
count int
errCount int
}
@@ -43,7 +43,7 @@ type SpanException struct {
elapsed int
maxElapsed int
minElapsed int
averageElapsed int
averageElapsed float64
count int
errCount int
}
@@ -25,10 +25,10 @@ func (spanSQLs *SpanSQLs) sqlCounter(events []*trace.TSpanEvent, chunkEvents []*
if len(ans) >= 0 {
for _, an := range ans {
if an.GetKey() == 20 {
sql, ok := spanSQLs.sqls[an.GetValue().GetIntValue()]
sql, ok := spanSQLs.sqls[an.Value.GetIntStringStringValue().GetIntValue()]
if !ok {
sql = NewSpanSQL()
spanSQLs.sqls[an.GetValue().GetIntValue()] = sql
spanSQLs.sqls[an.Value.GetIntStringStringValue().GetIntValue()] = sql
}
sql.count++
elapsed := int(event.EndElapsed)
@@ -46,7 +46,7 @@ func (spanSQLs *SpanSQLs) sqlCounter(events []*trace.TSpanEvent, chunkEvents []*
sql.errCount++
}

sql.averageElapsed = sql.elapsed / sql.count
sql.averageElapsed = float64(sql.elapsed) / float64(sql.count)
}
}
}
@@ -78,7 +78,7 @@ func (spanSQLs *SpanSQLs) sqlCounter(events []*trace.TSpanEvent, chunkEvents []*
sql.errCount++
}

sql.averageElapsed = sql.elapsed / sql.count
sql.averageElapsed = float64(sql.elapsed) / float64(sql.count)
}
}
}
@@ -99,7 +99,7 @@ func (spanSQLs *SpanSQLs) sqlRecord(app *App, recordTime int64) error {
sql.maxElapsed,
sql.minElapsed,
sql.averageElapsed, sql.count,
sql.averageElapsed,
sql.errCount,
).Exec(); err != nil {
g.L.Warn("sqlRecord error", zap.String("error", err.Error()), zap.String("SQL", gInserSQLRecord))
}
@@ -109,7 +109,7 @@ func (spanSQLs *SpanSQLs) sqlRecord(app *App, recordTime int64) error {

// SpanSQL ...
type SpanSQL struct {
averageElapsed int
averageElapsed float64
elapsed int
count int
errCount int
@@ -39,7 +39,7 @@ func (spanUrls *SpanURLs) urlCounter(urlStr string, elapsed int, isError int) er
url.minElapsed = elapsed
}

url.averageElapsed = url.elapsed / url.count
url.averageElapsed = float64(url.elapsed) / float64(url.count)

if elapsed < misc.Conf.Stats.SatisfactionTime {
url.satisfactionCount++
@@ -77,7 +77,7 @@ func (spanUrls *SpanURLs) urlRecord(app *App, recordTime int64) error {

// SpanURL ...
type SpanURL struct {
averageElapsed int
averageElapsed float64
elapsed int
count int
errCount int
@@ -237,7 +237,7 @@ CREATE TABLE IF NOT EXISTS rpc_stats (
total_elapsed int,
max_elapsed int,
min_elapsed int,
average_elapsed int,
average_elapsed double,
count int,
err_count int,
satisfaction int,
@@ -271,7 +271,7 @@ CREATE TABLE IF NOT EXISTS rpc_details_stats (
ratio_elapsed FLOAT,
max_elapsed int,
min_elapsed int,
average_elapsed int,
average_elapsed double,
count int,
err_count int,
PRIMARY KEY (app_name, url, input_date, api_id)
@@ -288,7 +288,7 @@ CREATE TABLE IF NOT EXISTS sql_stats (
elapsed int,
max_elapsed int,
min_elapsed int,
average_elapsed int,
average_elapsed double,
count int,
err_count int,
PRIMARY KEY (app_name, sql, input_date)
@@ -324,6 +324,15 @@ CREATE CUSTOM INDEX IF NOT EXISTS ON jvm_memory_stats (input_date)
USING 'org.apache.cassandra.index.sasi.SASIIndex'
WITH OPTIONS = {'mode': 'SPARSE'};


CREATE TABLE IF NOT EXISTS service_type (
ser_type int,
info text,
PRIMARY KEY (ser_type)
) WITH gc_grace_seconds = 10800;



-- TRUNCATE TABLE app_strs;
-- TRUNCATE TABLE agent_stats;
-- TRUNCATE TABLE traces_chunk;
@@ -4,8 +4,8 @@ common:
admintoken: "vgo.io"

vgo:
# listenaddr: "10.50.18.157:8081"
listenaddr: "127.0.0.1:8081"
listenaddr: "10.50.50.36:8081"
# listenaddr: "127.0.0.1:8081"
agenttimeout: 5

storage:

0 comments on commit ef6a81c

Please sign in to comment.