Skip to content

Commit

Permalink
#813 add State validation on getting mem delta
Browse files Browse the repository at this point in the history
  • Loading branch information
zhabis committed Feb 2, 2023
1 parent a0da4e9 commit 6112771
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Azos.Sky.Server/Fabric/Server/FiberProcessorDaemon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ private sealed class daemonRuntime : ApplicationComponent<FiberProcessorDaemon>,
public daemonRuntime(FiberProcessorDaemon director) : base(director){ }
public override string ComponentLogTopic => CoreConsts.FABRIC_TOPIC;

public override MessageType ComponentEffectiveLogLevel => ComponentDirector.ComponentEffectiveLogLevel;
public override string ComponentLogFromPrefix => $"@{ComponentSID}:FabProcNode(`{ComponentDirector.ProcessorId}`).";

public int Version => VERSION_YYYYMMDD;
public float SystemLoadCoefficient => ComponentDirector.SystemLoadCoefficient;
public bool IsRunning => ComponentDirector.Running;
Expand Down
24 changes: 24 additions & 0 deletions src/Azos.Sky/Fabric/Fiber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,30 @@ internal void __processor__ctor(IFiberRuntime runtime, FiberParameters pars, Fib
/// </summary>
public FiberState State => m_State;



/// <summary>
/// Fiber processor log writer.
/// Logging depends on <see cref="IApplicationComponent.ComponentEffectiveLogLevel"/> of the processor runtime
/// </summary>
public Guid WriteLog(Azos.Log.MessageType type,
string from,
string text,
Exception error = null,
Guid? related = null,
string pars = null,
[System.Runtime.CompilerServices.CallerFilePath] string file = null,
[System.Runtime.CompilerServices.CallerLineNumber] int src = 0)
{
var rtc = Runtime.CastTo<ApplicationComponent>("Runtime is AC");

var ff = $"{GetType().DisplayNameWithExpandedGenericArgs()}(`{State.CurrentStep}`)";
from = from.IsNotNullOrWhiteSpace() ? $"{ff}.{from}" : ff;

return rtc.WriteLog(type, from, text, error, related, pars, file, src);
}


/// <summary>
/// Interprets the incoming signal by performing some work and generates <see cref="FiberSignalResult"/>.
/// Returns null if the signal is unhandled.
Expand Down
2 changes: 1 addition & 1 deletion src/Azos.Sky/Fabric/Intfs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,6 @@ public interface IFiberRuntime : IApplicationComponent
/// emails and direct emails at debugging endpoint instead, or add "TESTING" watermark
/// </summary>
bool IsDebugging { get; }
}

}
}

0 comments on commit 6112771

Please sign in to comment.