From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 21:24:15 +1000 Subject: Dump OpenSim 0.9.0.1 into it's own branch. --- .../UserStatistics/WebStatsModule.cs | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs') diff --git a/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs b/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs index f6772db..c15b194 100644 --- a/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs @@ -57,7 +57,7 @@ namespace OpenSim.Region.UserStatistics { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private static SqliteConnection dbConn; /// @@ -67,7 +67,7 @@ namespace OpenSim.Region.UserStatistics private List m_scenes = new List(); private Dictionary reports = new Dictionary(); - private Dictionary m_simstatsCounters = new Dictionary(); + private Dictionary m_simstatsCounters = new Dictionary(); private const int updateStatsMod = 6; private int updateLogMod = 1; private volatile int updateLogCounter = 0; @@ -96,7 +96,7 @@ namespace OpenSim.Region.UserStatistics //IConfig startupConfig = config.Configs["Startup"]; - dbConn = new SqliteConnection("URI=file:../db/LocalUserStatistics.db,version=3"); + dbConn = new SqliteConnection("URI=file:LocalUserStatistics.db,version=3"); dbConn.Open(); CreateTables(dbConn); @@ -217,7 +217,7 @@ namespace OpenSim.Region.UserStatistics { m_loglines = readLogLines(10); - if (updateLogCounter > 10000) + if (updateLogCounter > 10000) updateLogCounter = 1; } @@ -228,12 +228,12 @@ namespace OpenSim.Region.UserStatistics ss.ConsumeSimStats(stats); } } - } + } catch (KeyNotFoundException) { } } - + private Hashtable HandleUnknownCAPSRequest(Hashtable request) { //string regpath = request["uri"].ToString(); @@ -257,7 +257,7 @@ namespace OpenSim.Region.UserStatistics int response_code = 404; string contenttype = "text/html"; bool jsonFormatOutput = false; - + string strOut = string.Empty; // The request patch should be "/SStats/reportName" where 'reportName' @@ -288,15 +288,15 @@ namespace OpenSim.Region.UserStatistics repParams["SimStats"] = m_simstatsCounters; repParams["LogLines"] = m_loglines; repParams["Reports"] = reports; - + concurrencyCounter++; - if (jsonFormatOutput) + if (jsonFormatOutput) { strOut = rep.RenderJson(rep.ProcessModel(repParams)); contenttype = "text/json"; } - else + else { strOut = rep.RenderView(rep.ProcessModel(repParams)); } @@ -312,7 +312,7 @@ namespace OpenSim.Region.UserStatistics } concurrencyCounter--; - + response_code = 200; } else @@ -463,7 +463,7 @@ namespace OpenSim.Region.UserStatistics UUID agentID, Caps caps) { // m_log.DebugFormat("[WEB STATS MODULE]: Received viewer starts report from {0}", agentID); - + UpdateUserStats(ParseViewerStats(request, agentID), dbConn); return String.Empty; @@ -525,7 +525,7 @@ namespace OpenSim.Region.UserStatistics } } } - + usd = uid.session_data; if (message.Type != OSDType.Map) @@ -747,16 +747,16 @@ namespace OpenSim.Region.UserStatistics );"; private const string SQL_STATS_TABLE_INSERT = @"INSERT OR REPLACE INTO stats_session_data ( -session_id, agent_id, region_id, last_updated, remote_ip, name_f, name_l, avg_agents_in_view, min_agents_in_view, max_agents_in_view, -mode_agents_in_view, avg_fps, min_fps, max_fps, mode_fps, a_language, mem_use, meters_traveled, avg_ping, min_ping, max_ping, mode_ping, +session_id, agent_id, region_id, last_updated, remote_ip, name_f, name_l, avg_agents_in_view, min_agents_in_view, max_agents_in_view, +mode_agents_in_view, avg_fps, min_fps, max_fps, mode_fps, a_language, mem_use, meters_traveled, avg_ping, min_ping, max_ping, mode_ping, regions_visited, run_time, avg_sim_fps, min_sim_fps, max_sim_fps, mode_sim_fps, start_time, client_version, s_cpu, s_gpu, s_os, s_ram, d_object_kb, d_texture_kb, d_world_kb, n_in_kb, n_in_pk, n_out_kb, n_out_pk, f_dropped, f_failed_resends, f_invalid, f_off_circuit, f_resent, f_send_packet ) VALUES ( -:session_id, :agent_id, :region_id, :last_updated, :remote_ip, :name_f, :name_l, :avg_agents_in_view, :min_agents_in_view, :max_agents_in_view, -:mode_agents_in_view, :avg_fps, :min_fps, :max_fps, :mode_fps, :a_language, :mem_use, :meters_traveled, :avg_ping, :min_ping, :max_ping, :mode_ping, +:session_id, :agent_id, :region_id, :last_updated, :remote_ip, :name_f, :name_l, :avg_agents_in_view, :min_agents_in_view, :max_agents_in_view, +:mode_agents_in_view, :avg_fps, :min_fps, :max_fps, :mode_fps, :a_language, :mem_use, :meters_traveled, :avg_ping, :min_ping, :max_ping, :mode_ping, :regions_visited, :run_time, :avg_sim_fps, :min_sim_fps, :max_sim_fps, :mode_sim_fps, :start_time, :client_version, :s_cpu, :s_gpu, :s_os, :s_ram, :d_object_kb, :d_texture_kb, :d_world_kb, :n_in_kb, :n_in_pk, :n_out_kb, :n_out_pk, :f_dropped, :f_failed_resends, :f_invalid, :f_off_circuit, :f_resent, :f_send_packet @@ -980,7 +980,7 @@ VALUES if ((srtArr[srtArr.Length - 1]) == 0 || (srtArr[srtArr.Length - 1]) == 1) return 0; - + float freqtest = (float)freq.Length / freq.Rank; for (i = 0; i < freqtest; i++) @@ -1116,7 +1116,7 @@ VALUES public List _sim_fps; public List _agents_in_view; } - + #endregion public class USimStatsData @@ -1197,7 +1197,7 @@ VALUES m_pendingDownloads = stats.StatsBlock[17].StatValue; m_pendingUploads = stats.StatsBlock[18].StatValue; m_activeScripts = stats.StatsBlock[19].StatValue; - m_scriptLinesPerSecond = stats.StatsBlock[20].StatValue; + m_scriptLinesPerSecond = stats.ExtraStatsBlock[0].StatValue; } } } \ No newline at end of file -- cgit v1.1 From 28b3b1c62d9fad9811986aad185121fed3f3b755 Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 22:03:18 +1000 Subject: Move db directory out of tree. --- OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs') diff --git a/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs b/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs index c15b194..f76b057 100644 --- a/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs @@ -96,7 +96,7 @@ namespace OpenSim.Region.UserStatistics //IConfig startupConfig = config.Configs["Startup"]; - dbConn = new SqliteConnection("URI=file:LocalUserStatistics.db,version=3"); + dbConn = new SqliteConnection("URI=file:" + Util.dbDir() + "/LocalUserStatistics.db,version=3"); dbConn.Open(); CreateTables(dbConn); @@ -1200,4 +1200,4 @@ VALUES m_scriptLinesPerSecond = stats.ExtraStatsBlock[0].StatValue; } } -} \ No newline at end of file +} -- cgit v1.1