Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions needed for dashboard metrics #39

Open
dotnetshadow opened this issue Dec 15, 2016 · 2 comments
Open

Extensions needed for dashboard metrics #39

dotnetshadow opened this issue Dec 15, 2016 · 2 comments

Comments

@dotnetshadow
Copy link

dotnetshadow commented Dec 15, 2016

Hi there,

I noticed with the latest release 1.6.7.7, you have an extension method to use .UseRedisStore() which is nice.

The problem I'm facing now is that if I use this extension method then I'm not sure how I can read dashboardmetrics without passing in a storage and redefining the storage:

services.AddHangfire(configuration =>
{
                configuration.UseRedisStorage("127.0.0.1:6379,allowAdmin=true,abortConnect=false", new RedisStorageOptions { Db = 1, Prefix = "hangfire:app1:", SucceededListSize = 10, DeletedListSize = 10 });
                configuration.UseColouredConsoleLogProvider();
});

// NEED TO GET STORAGE HERE----------------------------V
GlobalConfiguration.Configuration.UseDashboardMetric(storage.GetDashboardMetricFromRedisInfo("Redis Version", RedisInfoKeys.redis_version));

I've actually seen another library implement this by allowing the RedisStrorage to have an extension method. You can see details of this here
https://github.com/BoltR/Hangfire.Redis.StackExchange

@marcoCasamento
Copy link
Owner

Yep, that has been added by @codeyu, a fluent syntax for configuration really helps on readability.
Seems like a nice addition, would you mind a PR ?

@pieceofsummer
Copy link
Contributor

I think GetDashboardMetricFromRedisInfo() should not be an instance method of RedisStorage at all. It can safely be made static, or even turn into an extension method on IGlobalConfiguration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants