Skip to content

Commit

Permalink
Implemented StarTime and Uptime
Browse files Browse the repository at this point in the history
  • Loading branch information
marcpiechura committed Jan 14, 2016
1 parent 752289e commit 9fa300c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/Akka.API.Tests/CoreAPISpec.ApproveCore.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,10 @@ namespace Akka.Actor
public abstract Akka.Actor.IScheduler Scheduler { get; }
public abstract Akka.Serialization.Serialization Serialization { get; }
public abstract Akka.Actor.Settings Settings { get; }
public System.TimeSpan StartTime { get; }
[System.ObsoleteAttribute("Use WhenTerminated instead. This property will be removed in future versions")]
public abstract System.Threading.Tasks.Task TerminationTask { get; }
public System.TimeSpan Uptime { get; }
public abstract System.Threading.Tasks.Task WhenTerminated { get; }
public abstract Akka.Actor.IActorRef ActorOf(Akka.Actor.Props props, string name = null);
public abstract Akka.Actor.ActorSelection ActorSelection(Akka.Actor.ActorPath actorPath);
Expand Down Expand Up @@ -3765,7 +3767,7 @@ namespace Akka.Routing
}
public class DefaultResizer : Akka.Routing.Resizer, System.IEquatable<Akka.Routing.DefaultResizer>
{
public DefaultResizer(int lower, int upper, int pressureThreshold = 1, double rampupRate = 0.2, double backoffThreshold = 0.3, double backoffRate = 0.1, int messagesPerResize = 10) { }
public DefaultResizer(int lower, int upper, int pressureThreshold = 1, double rampupRate = 0,2, double backoffThreshold = 0,3, double backoffRate = 0,1, int messagesPerResize = 10) { }
public double BackoffRate { get; }
public double BackoffThreshold { get; }
public int LowerBound { get; set; }
Expand Down
11 changes: 11 additions & 0 deletions src/core/Akka/Actor/ActorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Akka.Configuration;
using Akka.Dispatch;
using Akka.Event;
using Akka.Util;

namespace Akka.Actor
{
Expand Down Expand Up @@ -73,6 +74,16 @@ public abstract class ActorSystem : IActorRefFactory, IDisposable
/// <summary>Gets the log</summary>
public abstract ILoggingAdapter Log { get; }

/// <summary>
/// Start-up time since the epoch.
/// </summary>
public TimeSpan StartTime { get; } = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);

/// <summary>
/// Up-time of this actor system.
/// </summary>
public TimeSpan Uptime => MonotonicClock.ElapsedHighRes;

/// <summary>
/// Creates a new ActorSystem with the specified name, and the specified Config
/// </summary>
Expand Down

0 comments on commit 9fa300c

Please sign in to comment.