mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine log for stats network and disk
This commit is contained in:
parent
6f700f3f40
commit
9c11001391
3 changed files with 26 additions and 2 deletions
|
@ -44,6 +44,7 @@ using namespace std;
|
||||||
#include <srs_core_autofree.hpp>
|
#include <srs_core_autofree.hpp>
|
||||||
#include <srs_app_source.hpp>
|
#include <srs_app_source.hpp>
|
||||||
#include <srs_kernel_file.hpp>
|
#include <srs_kernel_file.hpp>
|
||||||
|
#include <srs_app_utility.hpp>
|
||||||
|
|
||||||
using namespace _srs_internal;
|
using namespace _srs_internal;
|
||||||
|
|
||||||
|
@ -1448,6 +1449,30 @@ int SrsConfig::check_config()
|
||||||
get_stats_network(), ret);
|
get_stats_network(), ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
if (true) {
|
||||||
|
vector<std::string> ips = srs_get_local_ipv4_ips();
|
||||||
|
int index = get_stats_network();
|
||||||
|
if (index >= (int)ips.size()) {
|
||||||
|
ret = ERROR_SYSTEM_CONFIG_INVALID;
|
||||||
|
srs_error("stats network invalid, total local ip count=%d, index=%d, ret=%d",
|
||||||
|
(int)ips.size(), index, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
srs_warn("stats network use index=%d, ip=%s", index, ips.at(index).c_str());
|
||||||
|
}
|
||||||
|
if (true) {
|
||||||
|
SrsConfDirective* conf = get_stats_disk_device();
|
||||||
|
if (conf == NULL || (int)conf->args.size() <= 0) {
|
||||||
|
srs_warn("stats disk not configed, disk iops disabled.");
|
||||||
|
} else {
|
||||||
|
string disks;
|
||||||
|
for (int i = 0; i < (int)conf->args.size(); i++) {
|
||||||
|
disks += conf->args.at(i);
|
||||||
|
disks += " ";
|
||||||
|
}
|
||||||
|
srs_warn("stats disk list: %s", disks.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// check http api
|
// check http api
|
||||||
|
|
|
@ -943,7 +943,7 @@ void retrieve_local_ipv4_ips()
|
||||||
|
|
||||||
std::string ip = buf;
|
std::string ip = buf;
|
||||||
if (ip != SRS_CONSTS_LOCALHOST) {
|
if (ip != SRS_CONSTS_LOCALHOST) {
|
||||||
srs_trace("retrieve local ipv4 addresses: %s", ip.c_str());
|
srs_trace("retrieve local ipv4 ip=%s, index=%d", ip.c_str(), (int)ips.size());
|
||||||
ips.push_back(ip);
|
ips.push_back(ip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -610,7 +610,6 @@ extern SrsNetworkRtmpServer* srs_get_network_rtmp_server();
|
||||||
extern void srs_update_rtmp_server(int nb_conn, SrsKbps* kbps);
|
extern void srs_update_rtmp_server(int nb_conn, SrsKbps* kbps);
|
||||||
|
|
||||||
// get local ip, fill to @param ips
|
// get local ip, fill to @param ips
|
||||||
extern void srs_retrieve_local_ipv4_ips();
|
|
||||||
extern std::vector<std::string>& srs_get_local_ipv4_ips();
|
extern std::vector<std::string>& srs_get_local_ipv4_ips();
|
||||||
|
|
||||||
// get local or peer ip.
|
// get local or peer ip.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue