本文整理汇总了C#中IAnalytics类的典型用法代码示例。如果您正苦于以下问题:C# IAnalytics类的具体用法?C# IAnalytics怎么用?C# IAnalytics使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IAnalytics类属于命名空间,在下文中一共展示了IAnalytics类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Open
public static DeploymentStatusFile Open(string id, IEnvironment environment, IAnalytics analytics, IOperationLock statusLock)
{
return statusLock.LockOperation(() =>
{
string path = Path.Combine(environment.DeploymentsPath, id, StatusFile);
if (!FileSystemHelpers.FileExists(path))
{
return null;
}
try
{
XDocument document = null;
using (var stream = FileSystemHelpers.OpenRead(path))
{
document = XDocument.Load(stream);
}
return new DeploymentStatusFile(id, environment, statusLock, document);
}
catch (Exception ex)
{
// in the scenario where w3wp is abruptly terminated while xml is being written,
// we may end up with corrupted xml. we will handle the error and remove the problematic directory.
analytics.UnexpectedException(ex);
FileSystemHelpers.DeleteDirectorySafe(Path.GetDirectoryName(path), ignoreErrors: true);
// it is ok to return null as callers already handle null.
return null;
}
}, DeploymentStatusManager.LockTimeout);
}
示例2: StructuredTextLogger
public StructuredTextLogger(string path, IAnalytics analytics)
{
_depth = 0;
_path = path;
_analytics = analytics;
_structuredTextDocument = new StructuredTextDocument<LogEntry>(path,
// DateTime.ToString("o") => "2015-08-04T00:08:38.5489308Z"
e => string.Join(LogEntrySeparator, e.LogTime.ToString("o"), e.Message, e.Id, (int)e.Type),
str =>
{
var splitted = str.Split(new[] { LogEntrySeparator }, StringSplitOptions.None);
if (splitted.Length == 4)
{
var time = DateTime.Parse(splitted[0]).ToUniversalTime();
var message = UnsanitizeValue(splitted[1]);
var id = splitted[2];
var type = (LogEntryType)Int32.Parse(splitted[3]);
return new LogEntry(time, id, message, type);
}
else
{
throw new FormatException(string.Format("the log line \"{0}\" is in an invalid format", str));
}
});
}
示例3: TriggeredJobsScheduler
public TriggeredJobsScheduler(ITriggeredJobsManager triggeredJobsManager, ITraceFactory traceFactory, IAnalytics analytics, IEnvironment environment)
{
_triggeredJobsManager = triggeredJobsManager;
_traceFactory = traceFactory;
_environment = environment;
_jobsFileWatcher = new JobsFileWatcher(triggeredJobsManager.JobsBinariesPath, OnJobChanged, JobSettings.JobSettingsFileName, ListJobNames, traceFactory, analytics);
}
示例4: SiteExtensionController
public SiteExtensionController(ISiteExtensionManager manager, IEnvironment environment, ITraceFactory traceFactory, IAnalytics analytics)
{
_manager = manager;
_environment = environment;
_traceFactory = traceFactory;
_analytics = analytics;
_siteExtensionRoot = Path.Combine(_environment.RootPath, "SiteExtensions");
}
示例5: DynamicsCrmConnector
public DynamicsCrmConnector(ICrmServiceWrapper crmService, ILogger logger, IAnalytics analytics)
{
_crmService = crmService;
_logger = logger;
_analytics = analytics;
DynamicsMapper.Configure();
}
示例6: ContinuousJobRunner
public ContinuousJobRunner(string jobName, IEnvironment environment, IFileSystem fileSystem, IDeploymentSettingsManager settings, ITraceFactory traceFactory, IAnalytics analytics)
: base(jobName, Constants.ContinuousPath, environment, fileSystem, settings, traceFactory, analytics)
{
_continuousJobLogger = new ContinuousJobLogger(jobName, Environment, FileSystem, TraceFactory);
_disableFilePath = Path.Combine(JobBinariesPath, "disable.job");
_singletonFilePath = Path.Combine(JobBinariesPath, "singleton.job");
}
示例7: TriggeredJobsScheduler
public TriggeredJobsScheduler(ITriggeredJobsManager triggeredJobsManager, ITraceFactory traceFactory, IEnvironment environment, IAnalytics analytics)
{
_triggeredJobsManager = triggeredJobsManager;
_traceFactory = traceFactory;
_environment = environment;
_analytics = analytics;
_triggeredJobsManager.RegisterExtraEventHandlerForFileChange(OnJobChanged);
}
示例8: TriggeredJobSchedule
public TriggeredJobSchedule(TriggeredJob triggeredJob, Action<TriggeredJobSchedule> onSchedule, TriggeredJobSchedulerLogger logger, IAnalytics analytics)
{
TriggeredJob = triggeredJob;
_onSchedule = onSchedule;
Logger = logger;
_analytics = analytics;
_timer = new Timer(OnTimer, triggeredJob, Timeout.Infinite, Timeout.Infinite);
}
示例9: ContinuousJobRunner
public ContinuousJobRunner(ContinuousJob continuousJob, IEnvironment environment, IDeploymentSettingsManager settings, ITraceFactory traceFactory, IAnalytics analytics)
: base(continuousJob.Name, Constants.ContinuousPath, environment, settings, traceFactory, analytics)
{
_continuousJobLogger = new ContinuousJobLogger(continuousJob.Name, Environment, TraceFactory);
_disableFilePath = Path.Combine(continuousJob.JobBinariesRootPath, "disable.job");
_singletonLock = new LockFile(Path.Combine(JobDataPath, "singleton.job.lock"), TraceFactory);
}
示例10: DeploymentStatusManager
public DeploymentStatusManager(IEnvironment environment,
IAnalytics analytics,
IOperationLock statusLock)
{
_environment = environment;
_analytics = analytics;
_statusLock = statusLock;
_activeFile = Path.Combine(environment.DeploymentsPath, Constants.ActiveDeploymentFile);
}
示例11: SiteExtensionManager
public SiteExtensionManager(IContinuousJobsManager continuousJobManager, ITriggeredJobsManager triggeredJobManager, IEnvironment environment, IDeploymentSettingsManager settings, ITraceFactory traceFactory, HttpContextBase context, IAnalytics analytics)
{
_rootPath = Path.Combine(environment.RootPath, "SiteExtensions");
_baseUrl = context.Request.Url == null ? String.Empty : context.Request.Url.GetLeftPart(UriPartial.Authority).TrimEnd('/');
_localRepository = GetSourceRepository(_rootPath);
_continuousJobManager = continuousJobManager;
_triggeredJobManager = triggeredJobManager;
_environment = environment;
_settings = settings;
_traceFactory = traceFactory;
_analytics = analytics;
}
示例12: BaseJobRunner
protected BaseJobRunner(string jobName, string jobsTypePath, IEnvironment environment,
IDeploymentSettingsManager settings, ITraceFactory traceFactory, IAnalytics analytics)
{
TraceFactory = traceFactory;
Environment = environment;
Settings = settings;
JobName = jobName;
_analytics = analytics;
JobBinariesPath = Path.Combine(Environment.JobsBinariesPath, jobsTypePath, jobName);
JobTempPath = Path.Combine(Environment.TempPath, Constants.JobsPath, jobsTypePath, jobName);
JobDataPath = Path.Combine(Environment.DataPath, Constants.JobsPath, jobsTypePath, jobName);
_externalCommandFactory = new ExternalCommandFactory(Environment, Settings, Environment.RepositoryPath);
}
示例13: GetInstance
/// <summary>
/// Get Analytics Instance
/// </summary>
/// <param name="accountId">accountId, when you setup your app this would be generated for you.</param>
/// <param name="applicationId">applicationId, when you setup your app this would be generated for you</param>
/// <param name="applicationVersion"> applicationVersion, specify version of your app here, make sure you don't forget to update this</param>
/// <param name="uploadType">uploadType how data is going to be uploaded, UploadType.WhileUsingAsync | UploadType.Manual</param>
/// <returns>iAnalytics new or cached instance</returns>
/// <see cref="Integration Guidelines SDK Document"/>
public static IAnalytics GetInstance()
{
lock (objectToLock)
{
if (iAnalytics == null)
{
#if DEBUG
System.Diagnostics.Debug.WriteLine("created new analytics instance");
#endif
iAnalytics = new Analytics();
}
}
return iAnalytics;
}
示例14: DeploymentController
public DeploymentController(ITracer tracer,
IEnvironment environment,
IAnalytics analytics,
IDeploymentManager deploymentManager,
IDeploymentStatusManager status,
IOperationLock deploymentLock,
IRepositoryFactory repositoryFactory,
IAutoSwapHandler autoSwapHandler)
{
_tracer = tracer;
_environment = environment;
_analytics = analytics;
_deploymentManager = deploymentManager;
_status = status;
_deploymentLock = deploymentLock;
_repositoryFactory = repositoryFactory;
_autoSwapHandler = autoSwapHandler;
}
示例15: DeploymentManager
public DeploymentManager(ISiteBuilderFactory builderFactory,
IEnvironment environment,
ITraceFactory traceFactory,
IAnalytics analytics,
IDeploymentSettingsManager settings,
IDeploymentStatusManager status,
IOperationLock deploymentLock,
ILogger globalLogger,
IWebHooksManager hooksManager)
{
_builderFactory = builderFactory;
_environment = environment;
_traceFactory = traceFactory;
_analytics = analytics;
_deploymentLock = deploymentLock;
_globalLogger = globalLogger ?? NullLogger.Instance;
_settings = settings;
_status = status;
_hooksManager = hooksManager;
}