allegro / ralph_pricing Goto Github PK
View Code? Open in Web Editor NEWA pricing module for Ralph
License: Other
A pricing module for Ralph
License: Other
Please update authors list according to the reality of this project ;-)
https://github.com/allegro/ralph_pricing/blob/develop/AUTHORS
There should be extra step before calculating costs: checking plugins and overall preconditions. If plugin raise precondition error, calculation for single day should be interrupted.
Possible plugins preconditions:
Posible overall preconditions:
Notice that preconditions could be checked for single day or for interval.
The scenario is as follows (will be difficult to reproduce at your site):
The worker section in supervisord.conf looks like this:
[program:rqworker]
command=/home/ralph/bin/ralph rqworker default scrooge_report scrooge_costs scrooge_collect
priority=12
numprocs=4
process_name=rq%(process_num)s
user=ralph
group=ralph
and the piece of log related to described behaviour is as follows:
[02.04.2015 11:50:51,488] INFO [MainProcess 13585] report_pricing_objects_usages - Generating service environments dailyusages report from 2015-03-26 to 2015-04-02
[02.04.2015 11:50:51,522] INFO [MainProcess 13585] base_report - Report generated
[02.04.2015 11:51:02,602] INFO [MainProcess 13586] report_pricing_objects_usages - Generating service environments dailyusages report from 2015-03-26 to 2015-04-02
[02.04.2015 11:51:02,637] INFO [MainProcess 13586] base_report - Report generated
[02.04.2015 11:51:14,021] ERROR [MainProcess 21756] base - Internal Server Error: /scrooge/pricing-objects-usages-report/
Traceback (most recent call last):
File "/home/ralph/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 109, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/ralph/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 20, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/home/ralph/ralph_scrooge/src/ralph_scrooge/utils/security.py", line 24, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/home/ralph/local/lib/python2.7/site-packages/django/views/generic/base.py", line 48, in view
return self.dispatch(request, *args, **kwargs)
File "/home/ralph/ralph_develop/src/ralph/account/models.py", line 297, in inner_decorator
return func(self, *args, **kwargs)
File "/home/ralph/ralph_scrooge/src/ralph_scrooge/views/base.py", line 28, in dispatch
return super(Base, self).dispatch(*args, **kwargs)
File "/home/ralph/ralph_develop/src/ralph/ui/views/common.py", line 250, in dispatch
return super(MenuMixin, self).dispatch(request, *args, **kwargs)
File "/home/ralph/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in dispatch
return handler(request, *args, **kwargs)
File "/home/ralph/ralph_scrooge/src/ralph_scrooge/views/base_report.py", line 93, in get
**self.form.cleaned_data
File "/home/ralph/ralph_scrooge/src/ralph_scrooge/views/base_report.py", line 146, in run_on_worker
return self.report.run_on_worker(**kwargs)
File "/home/ralph/ralph_scrooge/src/ralph_scrooge/utils/worker_job.py", line 54, in run_on_worker
job = Job.fetch(job_id, connection)
File "/home/ralph/local/lib/python2.7/site-packages/rq/job.py", line 278, in fetch
job.refresh()
File "/home/ralph/local/lib/python2.7/site-packages/rq/job.py", line 377, in refresh
raise NoSuchJobError('No such job: %s' % (key,))
NoSuchJobError: No such job: rq:job:7ba2c4c9-01df-4b6f-8159-cbfc586c663b
It doesn't add reports_pricing to the list. What are the required queues to run ralph in minimal way?
Add CSV import to:
Assume that PricingService
PS_X has Service
S_Y in excluded services, and Service
S_Y is assigned to PricingService
PS_Y, which besides S_Y has also Service
s S_W, S_Z and S_A.
Service
s S_W, S_Z and S_A should be charged by PricingService
PS_X, but this line:
PricingService
PS_X (and Service
s S_W, S_Z, S_A which are assigned to it) won't be charged by PricingService
PS_X.I have install scrooge !
Is the data must sync from ralph ?
if yes , how to user "scrooge scrooge_ralph3_migrate_model -m -f "
-f FILE, --file FILE CSV file with mapping Ralph2 (U)ID;Ralph3 I
the CSV file is download from the ralph ?
thanks !!!!
Scrooge should allow to save negative costs in DailyCost instances (see
)"Master" job collect results from secondary level jobs, converts them to DailyCost
instances and at the end saves everything into database (using bulk save). Creating DailyCost
instances is unnecessary step which not only affect (time) performance but memory usage also - collected data could be transformed directly into SQL query (which also happen when using DailyCost
) - maybe DailyCost
could be used to automate it.
Besides that master job should be executed on separated queue (ex. scrooge_costs_master
- actually it's executed on scrooge_costs
with second-level jobs) to control it's destination in better way.
The scenario is as follows:
1/ For given usage type (UT) prices (or costs) are defined and matched only with warehouses (WH) using this UT (not all of existing WHs)
2/ Generate Monthly costs and then go to Cost report
3/ Cost for given UT equals 0.
To make it work (to show the real costs of this UT) the unused (fake) WH has to be selected in Usage Prices form for given UT and price/cost has to be set to 0).
Of course this (unused) WH uses other metrics (UTs) so the checkbox "Show warehouse in report" has to be selected.
The problem is how to make it work without selecting WH which does not use this UT
The scenario is for my Devices usages report vel. PDUs Usaged report. And it is as follows:
PDUS usages report can be now generated for both service<->environments pairs (service->old env and service->new env).
If I choose new environment the usages should start from the moment I moved the assets to a new location. But they don't. Report for a new service-environment pair shows also historical data (from the times when assets were associated with old environment)
Input fields should allow numbers with spaces (thousands separator) and commas (decimal separator)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.