Commit 7884e51f authored by Qianwen's avatar Qianwen
Browse files

Merge branch 'develop' of https://git.rwth-aachen.de/acs/public/cloud/mas/clonemap into webui

parents 77d38c75 6bd21675
Pipeline #468242 passed with stages
in 3 minutes and 27 seconds
......@@ -158,14 +158,14 @@ metadata:
# etcd.database.coreos.com/scope: clusterwide
spec:
size: 3
pod:
resources:
limits:
cpu: 300m
memory: 400Mi
requests:
cpu: 200m
memory: 300Mi
# pod:
# resources:
# limits:
# cpu: 300m
# memory: 400Mi
# requests:
# cpu: 200m
# memory: 300Mi
version: "3.2.24"
---
......@@ -359,13 +359,13 @@ spec:
value: "error"
- name: CLONEMAP_NAMESPACE
value: "clonemap"
resources:
requests:
memory: "128Mi"
cpu: "500m"
limits:
memory: "256Mi"
cpu: "600m"
# resources:
# requests:
# memory: "128Mi"
# cpu: "500m"
# limits:
# memory: "256Mi"
# cpu: "600m"
ports:
- containerPort: 9000
name: ams-port
......@@ -390,7 +390,7 @@ data:
CREATE TABLE clonemap.logging_msg ( masid int, agentid int, t timestamp, log varchar, PRIMARY KEY ((masid, agentid), t)) WITH CLUSTERING ORDER BY (t ASC);
CREATE TABLE clonemap.logging_status ( masid int, agentid int, t timestamp, log varchar, PRIMARY KEY ((masid, agentid), t)) WITH CLUSTERING ORDER BY (t ASC);
CREATE TABLE clonemap.logging_debug ( masid int, agentid int, t timestamp, log varchar, PRIMARY KEY ((masid, agentid), t)) WITH CLUSTERING ORDER BY (t ASC);
CREATE TABLE clonemap.logging_series ( masid int, agentid int, t timestamp, log varchar, PRIMARY KEY ((masid, agentid), t)) WITH CLUSTERING ORDER BY (t ASC);
CREATE TABLE clonemap.logging_series ( masid int, agentid int, name varchar, t timestamp, series varchar, PRIMARY KEY ((masid, agentid, name), t)) WITH CLUSTERING ORDER BY (t ASC);
CREATE TABLE clonemap.state ( masid int, agentid int, state varchar, PRIMARY KEY (masid, agentid));
EOF
......@@ -568,13 +568,13 @@ spec:
value: "production"
- name: CLONEMAP_LOG_LEVEL
value: "info"
resources:
requests:
memory: "128Mi"
cpu: "300m"
limits:
memory: "256Mi"
cpu: "400m"
# resources:
# requests:
# memory: "128Mi"
# cpu: "300m"
# limits:
# memory: "256Mi"
# cpu: "400m"
ports:
- containerPort: 11000
name: logger-port
......@@ -635,13 +635,13 @@ spec:
value: "production"
- name: CLONEMAP_LOG_LEVEL
value: "error"
resources:
requests:
memory: "128Mi"
cpu: "300m"
limits:
memory: "256Mi"
cpu: "400m"
# resources:
# requests:
# memory: "128Mi"
# cpu: "300m"
# limits:
# memory: "256Mi"
# cpu: "400m"
ports:
- containerPort: 12000
name: df-port
......@@ -702,13 +702,13 @@ spec:
value: "production"
- name: CLONEMAP_LOG_LEVEL
value: "error"
resources:
requests:
memory: "256Mi"
cpu: "500m"
limits:
memory: "512Mi"
cpu: "1"
# resources:
# requests:
# memory: "256Mi"
# cpu: "500m"
# limits:
# memory: "512Mi"
# cpu: "1"
ports:
- containerPort: 13000
name: fe-port
......
......@@ -320,10 +320,14 @@ func (logCol *LogCollector) storeState() (err error) {
states = append(states, state)
for i := 0; i < 24; i++ {
// maximum of 25 states
done := false
select {
case state = <-logCol.stateIn:
states = append(states, state)
default:
done = true
}
if done {
break
}
}
......
......@@ -192,8 +192,8 @@ func (stor *cassStorage) addAgentLogSeries(series schemas.LogSeries) {
// getAgentLogSeries get log series
func (stor *cassStorage) getAgentLogSeries(masID int, agentID int, name string, start time.Time, end time.Time) (series []schemas.LogSeries, err error) {
var iter *gocql.Iter
iter = stor.session.Query("SELECT log FROM logging_series WHERE masid = ? AND agentid = ? AND name = ?", masID,
agentID, name).Iter()
iter = stor.session.Query("SELECT series FROM logging_series WHERE masid = ? AND agentid = ? AND "+
"name = ? AND t > ? AND t < ?", masID, agentID, name, start, end).Iter()
var js []byte
for iter.Scan(&js) {
var logSeries schemas.LogSeries
......@@ -209,6 +209,13 @@ func (stor *cassStorage) getAgentLogSeries(masID int, agentID int, name string,
// getAgentLogSeriesNames get log series
func (stor *cassStorage) getAgentLogSeriesNames(masID int, agentID int) (names []string, err error) {
var iter *gocql.Iter
iter = stor.session.Query("SELECT distinct name FROM logging_series WHERE masid = ? AND agentid = ?", masID, agentID).Iter()
var js []byte
for iter.Scan(&js) {
names = append(names, string(js))
}
iter.Close()
return
}
......@@ -308,6 +315,7 @@ func (stor *cassStorage) storeLogs(topic string) {
if size > 25000 {
break
}
empty := false
select {
case log = <-logIn:
js, err = json.Marshal(log)
......@@ -317,6 +325,9 @@ func (stor *cassStorage) storeLogs(topic string) {
batch.Query(stmt, log.MASID, log.AgentID, log.Timestamp, js)
size += len(js)
default:
empty = true
}
if empty {
break
}
}
......@@ -330,7 +341,7 @@ func (stor *cassStorage) storeLogs(topic string) {
// storeSeries stores the log series in a batch operation
func (stor *cassStorage) storeSeries() {
var err error
stmt := "INSERT INTO logging_series (masid, agentid, name, t, log) VALUES (?, ?, ?, ?, ?)"
stmt := "INSERT INTO logging_series (masid, agentid, name, t, series) VALUES (?, ?, ?, ?, ?)"
for {
batch := gocql.NewBatch(gocql.UnloggedBatch)
......@@ -340,7 +351,7 @@ func (stor *cassStorage) storeSeries() {
if err != nil {
fmt.Println(err)
}
batch.Query(stmt, series.MASID, series.AgentID, series.Timestamp, series.Name, js)
batch.Query(stmt, series.MASID, series.AgentID, series.Name, series.Timestamp, js)
size := len(js)
for i := 0; i < 9; i++ {
// maximum of 10 operations in batch
......@@ -353,7 +364,7 @@ func (stor *cassStorage) storeSeries() {
if err != nil {
fmt.Println(err)
}
batch.Query(stmt, series.MASID, series.AgentID, series.Timestamp, js)
batch.Query(stmt, series.MASID, series.AgentID, series.Name, series.Timestamp, js)
size += len(js)
default:
break
......
......@@ -332,6 +332,12 @@ text {
.log-series-graph {
margin-top: 50px;
width: 1200px;
}
ngx-charts-bubble-chart {
padding-right: 100px;
}
.tt {
......
......@@ -160,7 +160,6 @@
<div [class.selected]="isTopicSelected[4]" class="app-tag tag" (click)="onToggleTopic(4)">app</div>
</div>
<!-- [xAxisTickFormatting]="xAxisTickFormatting" -->
<div class="log-series-graph" *ngIf="currState==='logSeries'">
<ngx-charts-bubble-chart *ngIf="selectedID.length !== 0"
......
......@@ -61,11 +61,11 @@ export class LoggerComponent implements OnInit {
names: string[] = []
logSeries: LogSeries[] = [];
bubbleData: pointSeries[] = [];
view: any[]= [1738, 600];
view: any[]= [1600, 600];
showXAxis: boolean = true;
showYAxis: boolean = true;
gradient: boolean = false;
showLegend: boolean = true;
showLegend: boolean = false;
showXAxisLabel: boolean = true;
xAxisLabel: string = 'Time';
showYAxisLabel: boolean = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment