Basic SyncConnector status for ssync status

dsg
Robert Adams 2011-03-08 12:59:46 -08:00
parent 59fbb9cbef
commit e0f28ac5ba
3 changed files with 35 additions and 7 deletions

View File

@ -1163,8 +1163,11 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
private void SyncStatus(Object[] args) private void SyncStatus(Object[] args)
{ {
//TO BE IMPLEMENTED m_log.WarnFormat("[REGION SYNC MODULE]: Description: {0}", SyncConnector.StatusTitle());
m_log.Warn("[REGION SYNC MODULE]: SyncStatus() TO BE IMPLEMENTED !!!"); ForEachSyncConnector(delegate(SyncConnector connector)
{
m_log.WarnFormat("{0}: {1}: {2}", "[REGION SYNC MODULE}", connector.Description, connector.StatusLine());
});
} }
private void SyncDebug(Object[] args) private void SyncDebug(Object[] args)

View File

@ -172,7 +172,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
{ {
if (entity is SceneObjectGroup) if (entity is SceneObjectGroup)
{ {
m_log.Warn(LogHeader + ": start script for obj " + entity.UUID); m_log.Debug(LogHeader + ": start script for obj " + entity.UUID);
SceneObjectGroup sog = (SceneObjectGroup)entity; SceneObjectGroup sog = (SceneObjectGroup)entity;
sog.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, 0); sog.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, 0);
sog.ResumeScripts(); sog.ResumeScripts();

View File

@ -33,7 +33,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
private long msgsOut=0; private long msgsOut=0;
private long bytesIn=0; private long bytesIn=0;
private long bytesOut=0; private long bytesOut=0;
private int msgCount = 0; private DateTime lastStatTime;
// A queue for outgoing traffic. // A queue for outgoing traffic.
private BlockingUpdateQueue m_outQ = new BlockingUpdateQueue(); private BlockingUpdateQueue m_outQ = new BlockingUpdateQueue();
@ -70,7 +70,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
{ {
if (m_syncOtherSideRegionName == null) if (m_syncOtherSideRegionName == null)
return String.Format("SyncConnector#{0}", m_connectorNum); return String.Format("SyncConnector#{0}", m_connectorNum);
return String.Format("SyncConnector #{0} (Actor {2}, Region {1:10})", m_connectorNum, m_syncOtherSideRegionName, m_syncOtherSideActorID); return String.Format("SyncConnector#{0}(A={2},R={1:10})",
m_connectorNum, m_syncOtherSideRegionName, m_syncOtherSideActorID);
} }
} }
@ -84,6 +85,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
m_tcpConnection = tcpclient; m_tcpConnection = tcpclient;
m_connectorNum = connectorNum; m_connectorNum = connectorNum;
m_regionSyncModule = syncModule; m_regionSyncModule = syncModule;
lastStatTime = DateTime.Now;
m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
} }
@ -97,6 +99,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
m_remoteListenerInfo = listenerInfo; m_remoteListenerInfo = listenerInfo;
m_connectorNum = connectorNum; m_connectorNum = connectorNum;
m_regionSyncModule = syncModule; m_regionSyncModule = syncModule;
lastStatTime = DateTime.Now;
m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
} }
@ -261,7 +264,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
private void HandleMessage(SymmetricSyncMessage msg) private void HandleMessage(SymmetricSyncMessage msg)
{ {
msgCount++; msgsIn++;
bytesIn += msg.Data.Length;
switch (msg.Type) switch (msg.Type)
{ {
case SymmetricSyncMessage.MsgType.RegionName: case SymmetricSyncMessage.MsgType.RegionName:
@ -294,5 +298,26 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
//Later on, we may deliver messages to different modules, say sync message to RegionSyncModule and event message to ActorSyncModule. //Later on, we may deliver messages to different modules, say sync message to RegionSyncModule and event message to ActorSyncModule.
m_regionSyncModule.HandleIncomingMessage(msg, m_syncOtherSideActorID); m_regionSyncModule.HandleIncomingMessage(msg, m_syncOtherSideActorID);
} }
public string StatusLine()
{
string statLine = "";
lock (stats)
{
double secondsSinceLastStats = DateTime.Now.Subtract(lastStatTime).TotalSeconds;
lastStatTime = DateTime.Now;
statLine = String.Format("{0},{1},{2},{3},{4},{5},{6}",
msgsIn, msgsOut, bytesIn, bytesOut, m_outQ.Count,
8 * (bytesIn / secondsSinceLastStats / 1000000),
8 * (bytesOut / secondsSinceLastStats / 1000000) );
msgsIn = msgsOut = bytesIn = bytesOut = 0;
}
return statLine;
}
public static string StatusTitle()
{
return "msgsIn,msgsOut,queueSize,Mbps In,Mbps Out";
}
} }
} }