Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
bfe7a1c
ms stats thread added
Oct 14, 2021
e4b2d69
initial data collection for management server
Oct 19, 2021
0ce784b
empty list management server metrics command
Oct 19, 2021
1f039f0
bean copy into MS metrics object
Oct 20, 2021
1863967
ms status VO
Oct 20, 2021
de3b69e
further API and DB plumbing
Oct 20, 2021
29b93d5
minimal metrics response in API
Oct 21, 2021
742aa70
remove commented, refactor data collection plumbing
Oct 22, 2021
e78a0cd
javadocs
Oct 22, 2021
5d5aab5
surpress stacktrace on expected error
Oct 22, 2021
67ded98
update status experiment
Oct 22, 2021
baeb7ea
ms status publish framework added
Oct 25, 2021
d8ae1ed
review comment addressed
Oct 25, 2021
ebd4c82
static data to DB and API, /proc/ reading
Oct 26, 2021
d11c227
addressing review comments
Oct 26, 2021
7919536
ui for ms details
Oct 27, 2021
acac5c2
small ui adjustment
Oct 28, 2021
553292e
beanCopy
Oct 28, 2021
86d077d
agentcount response and system parameter
Oct 28, 2021
b271e17
labels
Nov 4, 2021
3de1321
package-lock
Nov 4, 2021
2b8f2d2
add version strings to regular list API
Nov 4, 2021
e500fde
add shutdown time to DB
Nov 5, 2021
54f46fb
add last start and last stop to regular list response
Nov 5, 2021
9d3fe7e
distro info in regular response/session count added
Nov 5, 2021
cd5b0f5
metrics as details
Nov 5, 2021
a5b68e9
add heap used and remove details map
Nov 9, 2021
0b92db3
thread-statusses
Nov 15, 2021
5b4697f
move db upgrade to 4.17
Nov 15, 2021
0b15e0f
sysmem
Nov 15, 2021
70c3164
procmem
Nov 16, 2021
267be46
ui demo comments applied
Nov 16, 2021
27a1589
javadoc
Nov 17, 2021
e772476
get conf and log file locations
Nov 17, 2021
2e70614
loginfo
Nov 17, 2021
675a4ae
cpuLoadStats
Nov 17, 2021
8ea7be0
no.remote
Nov 18, 2021
99703fd
extra spaces removed
Nov 18, 2021
5ef0e0f
clusterlistener
Nov 18, 2021
b31af5e
add unit to kb value
Nov 18, 2021
5b6b1e7
revert accidental rename
Nov 18, 2021
8f099f2
silly fqcn removed
Nov 18, 2021
5baab36
get mem info from bean is possible
Nov 18, 2021
bbaaae1
refactor long sequence for readability
Nov 18, 2021
caf402f
registerListener
Nov 19, 2021
929b905
listUsageMetrics and isDbLocal
Nov 19, 2021
356a3af
rats
Nov 19, 2021
eacda71
local usage and db or not
Nov 22, 2021
258b871
minimal listDbMetrics
Nov 22, 2021
982d1a6
db vars and stats
Nov 23, 2021
ee4ac6d
cleanup and #queries queried
Nov 24, 2021
f398bed
db stats calculation
Nov 24, 2021
a1a2260
rat
Nov 25, 2021
d111b55
remove list response wrapper from sinlge details-lists responses
Nov 25, 2021
227c35f
rudimentary metrics view
Nov 30, 2021
d45f8dc
metrics table cleanup
Dec 1, 2021
b9c8f97
table makeup, collection dates
Dec 15, 2021
e91771f
move component to appropriate location
Dec 15, 2021
477f9d2
capitalisation removed
Dec 15, 2021
076d6a7
rebase error resolved
Dec 15, 2021
d57f237
rename deamon to daemon
Dec 15, 2021
5d34448
small style comments applied
Dec 15, 2021
d907572
another merge issue
Dec 15, 2021
a6a7e0e
naming comments and boot time
Dec 16, 2021
d7ddf36
stop/start prefixed with server
Dec 16, 2021
726c03f
layout-fix
Dec 17, 2021
8ea08b4
listMSMetrics test and test refactor
Dec 20, 2021
d1f5fc5
usage metrics test
Dec 20, 2021
b0a4240
db metrics test
Dec 20, 2021
6076e9b
extra validations
Dec 20, 2021
b22fe87
Update ui/public/locales/en.json
DaanHoogland Dec 23, 2021
3a7b3b7
descriptions of loadaverages and replica's
Dec 27, 2021
65b2844
collection time on top
Dec 27, 2021
a2c6897
cpu load on metrics overview
Dec 27, 2021
7b89e09
DbStatsCollection
Dec 27, 2021
90fe7da
some parameter description texts
Dec 27, 2021
87d81b5
labels adjusted
Dec 27, 2021
544f052
new output 'kernelversion' and log info cleanup
Dec 27, 2021
37c8200
labels
Jan 3, 2022
92dbd1f
Update api/src/main/java/com/cloud/server/ManagementServerHostStats.java
DaanHoogland Jan 3, 2022
38704d1
Update plugins/metrics/src/main/java/org/apache/cloudstack/response/D…
DaanHoogland Jan 3, 2022
f5b3ab0
Update framework/cluster/src/main/java/com/cloud/cluster/dao/Manageme…
DaanHoogland Jan 5, 2022
d8b5c5b
Update framework/cluster/src/main/java/com/cloud/cluster/ClusterManag…
DaanHoogland Jan 11, 2022
54192f7
Update api/src/main/java/org/apache/cloudstack/api/response/Managemen…
DaanHoogland Jan 11, 2022
0ae1d43
Update api/src/main/java/org/apache/cloudstack/api/response/Managemen…
DaanHoogland Jan 11, 2022
3ebcf60
Update engine/schema/src/main/java/com/cloud/host/dao/HostDao.java
DaanHoogland Jan 11, 2022
42f526b
Update framework/cluster/src/main/java/com/cloud/cluster/ClusterManag…
DaanHoogland Jan 11, 2022
2e4f6d8
Update framework/cluster/src/main/java/com/cloud/cluster/ClusterManag…
DaanHoogland Jan 11, 2022
7362aee
Update server/src/main/java/com/cloud/server/StatsCollector.java
DaanHoogland Jan 11, 2022
8088167
Update framework/cluster/src/main/java/com/cloud/cluster/ClusterManag…
DaanHoogland Jan 11, 2022
469116e
Update framework/cluster/src/main/java/com/cloud/cluster/ClusterManag…
DaanHoogland Jan 11, 2022
6927fd8
Update framework/cluster/src/main/java/com/cloud/cluster/dao/Manageme…
DaanHoogland Jan 11, 2022
066f3fa
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
8c6df4a
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
7fbac63
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
6428310
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
65d2d3f
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
9dfed65
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
1c29f50
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
23da5f7
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
8cfa142
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
b296378
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
cfbc648
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
c445a7b
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
dc29a83
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
28af910
Update server/src/main/java/com/cloud/server/StatsCollector.java
DaanHoogland Jan 11, 2022
73fbcd6
Update server/src/main/java/com/cloud/server/StatsCollector.java
DaanHoogland Jan 11, 2022
9ae9174
Update server/src/main/java/com/cloud/server/StatsCollector.java
DaanHoogland Jan 11, 2022
49baf8a
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
dae3d2b
Update plugins/metrics/src/main/java/org/apache/cloudstack/metrics/Me…
DaanHoogland Jan 11, 2022
075ece5
some (more) refactorring suggestions applied
Jan 12, 2022
a527d8a
human readable memory sizes
Jan 19, 2022
cbe600b
rat
Jan 27, 2022
00d721e
actual collection time instead of query time, improved descriptions
Jan 27, 2022
fe6b1e5
merge errors fixed
Jan 27, 2022
2969924
optional metric values
Jan 27, 2022
3667de6
javadoc and logging
Feb 2, 2022
86abec3
names of jmx vars have changed
Mar 2, 2022
de000ed
vue3-compatibility
Mar 11, 2022
e42cbb0
new output parameter type
Mar 16, 2022
4712b5b
lower retention default
Mar 30, 2022
d00ec0d
vue3 fixes
Mar 30, 2022
c7d6441
polish comments
Mar 30, 2022
f81bc92
polish comments 2, the reckoning
Mar 31, 2022
0ce29fd
note on usage servers
Mar 31, 2022
207402f
merge conflict errors
Apr 12, 2022
40e807a
pollish
Apr 13, 2022
4588793
Merge remote-tracking branch 'origin/main' into mshostStats
yadvr Apr 20, 2022
e2b91a4
conditional assertion to deal with simulator restart
Apr 20, 2022
164e6b2
Merge branch 'main' into mshostStats
DaanHoogland Apr 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions api/src/main/java/com/cloud/server/ManagementServerHostStats.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.server;

import java.util.Date;

/**
* management server related stats
*/
public interface ManagementServerHostStats {
Date getCollectionTime();

Date getSystemBootTime();

long getManagementServerHostId();

String getManagementServerHostUuid();

long getSessions();

double getCpuUtilization();

long getTotalJvmMemoryBytes();

double getFreeJvmMemoryBytes();

long getProcessJvmMemoryBytes();

long getJvmUptime();

long getJvmStartTime();

int getAvailableProcessors();

double getLoadAverage();

long getTotalInit();

long getTotalUsed();

long getMaxJvmMemoryBytes();

long getTotalCommitted();

long getPid();

String getJvmName();

String getJvmVendor();

String getJvmVersion();

String getOsDistribution();

int getAgentCount();

long getHeapMemoryUsed();

long getHeapMemoryTotal();

int getThreadsBlockedCount();

int getThreadsTotalCount();

int getThreadsDaemonCount();

int getThreadsRunnableCount();

int getThreadsTerminatedCount();

int getThreadsWaitingCount();

long getSystemMemoryTotal();

long getSystemMemoryFree();

long getSystemMemoryUsed();

long getSystemMemoryVirtualSize();

String getLogInfo();

/**
* @return in mega hertz
*/
double getSystemTotalCpuCycles();

double[] getSystemLoadAverages();

long[] getSystemCyclesUsage();

boolean isDbLocal();

boolean isUsageLocal();

String getKernelVersion();
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,17 @@ public class ApiConstants {
public static final String IS_RECURSIVE = "isrecursive";
public static final String ISO_FILTER = "isofilter";
public static final String ISO_GUEST_OS_NONE = "None";
public static final String JAVA_DISTRIBUTION = "javadistribution";
public static final String JAVA_VERSION = "javaversion";
public static final String JOB_ID = "jobid";
public static final String JOB_STATUS = "jobstatus";
public static final String KEEPALIVE_ENABLED = "keepaliveenabled";
public static final String KERNEL_VERSION = "kernelversion";
public static final String LABEL = "label";
public static final String LASTNAME = "lastname";
public static final String LAST_BOOT = "lastboottime";
public static final String LAST_SERVER_START = "lastserverstart";
public static final String LAST_SERVER_STOP = "lastserverstop";
public static final String LEVEL = "level";
public static final String LENGTH = "length";
public static final String LIMIT_CPU_USE = "limitcpuuse";
Expand All @@ -260,7 +267,6 @@ public class ApiConstants {
public static final String MIGRATION_TYPE = "migrationtype";
public static final String MEMORY = "memory";
public static final String MODE = "mode";
public static final String KEEPALIVE_ENABLED = "keepaliveenabled";
public static final String NAME = "name";
public static final String METHOD_NAME = "methodname";
public static final String NETWORK_DOMAIN = "networkdomain";
Expand All @@ -273,6 +279,7 @@ public class ApiConstants {
public static final String NEW_END_IP = "newendip";
public static final String NUM_RETRIES = "numretries";
public static final String OFFER_HA = "offerha";
public static final String OS_DISTRIBUTION = "osdistribution";
public static final String IS_SYSTEM_OFFERING = "issystem";
public static final String IS_DEFAULT_USE = "defaultuse";
public static final String OLD_FORMAT = "oldformat";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import org.apache.cloudstack.management.ManagementServerHost.State;

import java.util.Date;

@EntityReference(value = ManagementServerHost.class)
public class ManagementServerResponse extends BaseResponse {
Expand All @@ -35,12 +38,80 @@ public class ManagementServerResponse extends BaseResponse {

@SerializedName(ApiConstants.STATE)
@Param(description = "the state of the management server")
private ManagementServerHost.State state;
private State state;

@SerializedName(ApiConstants.VERSION)
@Param(description = "the version of the management server")
private String version;

@SerializedName(ApiConstants.JAVA_DISTRIBUTION)
@Param(description = "the java distribution name running the management server process")
private String javaDistribution;

@SerializedName(ApiConstants.JAVA_VERSION)
@Param(description = "the version of the java distribution running the management server process")
private String javaVersion;

@SerializedName(ApiConstants.OS_DISTRIBUTION)
@Param(description = "the name of the OS distribution running on the management server")
private String osDistribution;

@SerializedName(ApiConstants.LAST_SERVER_START)
@Param(description = "the last time this Management Server was started")
private Date lastServerStart;

@SerializedName(ApiConstants.LAST_SERVER_STOP)
@Param(description = "the last time this Management Server was stopped")
private Date lastServerStop;

@SerializedName(ApiConstants.LAST_BOOT)
@Param(description = "the last time the host on which this Management Server runs was booted")
private Date lastBoot;

@SerializedName(ApiConstants.KERNEL_VERSION)
@Param(description = "the running OS kernel version for this Management Server")
private String kernelVersion;

public String getId() {
return this.id;
}

public String getName() {
return this.name;
}

public State getState() {
return state;
}

public String getVersion() {
return version;
}

public String getJavaVersion() {
return javaVersion;
}

public String getJavaDistribution() {
return javaDistribution;
}

public String getOsDistribution() {
return osDistribution;
}

public Date getLastServerStart() {
return lastServerStart;
}

public Date getLastServerStop() {
return lastServerStop;
}

public Date getLastBoot() {
return lastBoot;
}

public void setId(String id) {
this.id = id;
}
Expand All @@ -49,11 +120,39 @@ public void setName(String name) {
this.name = name;
}

public void setState(ManagementServerHost.State state) {
public void setState(State state) {
this.state = state;
}

public void setVersion(String version) {
this.version = version;
}

public void setJavaDistribution(String javaDistribution) {
this.javaDistribution = javaDistribution;
}

public void setJavaVersion(String javaVersion) {
this.javaVersion = javaVersion;
}

public void setOsDistribution(String osDistribution) {
this.osDistribution = osDistribution;
}

public void setLastServerStart(Date lastServerStart) {
this.lastServerStart = lastServerStart;
}

public void setLastServerStop(Date lastServerStop) {
this.lastServerStop = lastServerStop;
}

public void setLastBoot(Date lastBoot) {
this.lastBoot = lastBoot;
}

public void setKernelVersion(String kernelVersion) {
this.kernelVersion = kernelVersion;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.management;

import org.apache.cloudstack.api.InternalIdentity;

import java.util.Date;

public interface ManagementServerStatus extends InternalIdentity {
long getId();

String getMsId();

Date getLastJvmStart();

Date getLastJvmStop();

Date getLastSystemBoot();

String getOsDistribution();

String getJavaName();

String getJavaVersion();

Date getUpdated();

Date getCreated();

Date getRemoved();
}
3 changes: 3 additions & 0 deletions client/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
<listener>
<listener-class>org.apache.cloudstack.spring.module.web.CloudStackContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>com.cloud.api.ApiSessionListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:META-INF/cloudstack/webApplicationContext.xml</param-value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import com.cloud.utils.nio.Link;

/**
* ConnectedAgentAttache implements an direct connection to this management server.
* ConnectedAgentAttache implements a direct connection to this management server.
*/
public class ConnectedAgentAttache extends AgentAttache {
private static final Logger s_logger = Logger.getLogger(ConnectedAgentAttache.class);
Expand Down
7 changes: 7 additions & 0 deletions engine/schema/src/main/java/com/cloud/host/dao/HostDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,11 @@ public interface HostDao extends GenericDao<HostVO, Long>, StateDao<Status, Stat
HostVO findByName(String name);

List<HostVO> listHostsWithActiveVMs(long offeringId);

/**
* Retrieves the number of hosts/agents this {@see ManagementServer} has responsibility over.
* @param msid the id of the {@see ManagementServer}
* @return the number of hosts/agents this {@see ManagementServer} has responsibility over
*/
int countByMs(long msid);
Comment thread
DaanHoogland marked this conversation as resolved.
}
12 changes: 12 additions & 0 deletions engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
protected SearchBuilder<HostVO> UnmanagedApplianceSearch;
protected SearchBuilder<HostVO> MaintenanceCountSearch;
protected SearchBuilder<HostVO> HostTypeCountSearch;
protected SearchBuilder<HostVO> ResponsibleMsCountSearch;
protected SearchBuilder<HostVO> HostTypeZoneCountSearch;
protected SearchBuilder<HostVO> ClusterStatusSearch;
protected SearchBuilder<HostVO> TypeNameZoneSearch;
Expand Down Expand Up @@ -179,6 +180,10 @@ public void init() {
HostTypeCountSearch.and("type", HostTypeCountSearch.entity().getType(), SearchCriteria.Op.EQ);
HostTypeCountSearch.done();

ResponsibleMsCountSearch = createSearchBuilder();
ResponsibleMsCountSearch.and("managementServerId", ResponsibleMsCountSearch.entity().getManagementServerId(), SearchCriteria.Op.EQ);
ResponsibleMsCountSearch.done();

HostTypeZoneCountSearch = createSearchBuilder();
HostTypeZoneCountSearch.and("type", HostTypeZoneCountSearch.entity().getType(), SearchCriteria.Op.EQ);
HostTypeZoneCountSearch.and("dc", HostTypeZoneCountSearch.entity().getDataCenterId(), SearchCriteria.Op.EQ);
Expand Down Expand Up @@ -1287,6 +1292,13 @@ public List<HostVO> listHostsWithActiveVMs(long offeringId) {
}
}

@Override
public int countByMs(long msid) {
Comment thread
DaanHoogland marked this conversation as resolved.
SearchCriteria<HostVO> sc = ResponsibleMsCountSearch.create();
sc.setParameters("managementServerId", msid);
Comment thread
DaanHoogland marked this conversation as resolved.
return getCount(sc);
}

@Override
public List<HostVO> listAllHostsByType(Host.Type type) {
SearchCriteria<HostVO> sc = TypeSearch.create();
Expand Down
Loading