hawat.blueprints.performance package
This pluggable module provides access to system performance statistics.
- hawat.blueprints.performance.BLUEPRINT_NAME = 'performance'
Name of the blueprint as module global constant.
- class hawat.blueprints.performance.DataView[source]
Bases:
FileNameView
View responsible for accessing raw performance data in RRD databases.
- authentication = True
Similar to the
decorators
mechanism in Flask pluggable views, you may use this class variable to specify, that the view is protected by authentication. During the process of registering the view into the blueprint inhawat.app.hawatBlueprint.register_view_class()
the view will be automatically decorated withflask_login.login_required()
decorator.The advantage of using this in favor of
decorators
is that the application menu can automatically hide/show items inaccessible to current user.This is a scalar variable that must contain boolean
True
orFalse
.
- classmethod get_directory_path()[source]
Return absolute path to the directory, that will be used as a base path for serving files.
This method does not have any default implementation and must be overridden by a subclass.
- Returns
Absolute path to the directory for serving files.
- Return type
str
- classmethod get_view_name()[source]
Return unique name for the view. Name must be unique in the namespace of parent blueprint/module and should contain only characters
[a-z0-9]
. It will be used for generating endpoint name for the view.This method does not have any default implementation and must be overridden by a subclass.
- Returns
Name for the view.
- Return type
str
- classmethod get_view_title(**kwargs)[source]
Return title for the view, that will be displayed in the
title
tag of HTMLhead
element and also as the content of page header inh2
tag.Default implementation returns the return value of
hawat.view.BaseView.get_menu_title()
method by default.- Parameters
kwargs (dict) – Optional parameters.
- Returns
Title for the view.
- Return type
str
- class hawat.blueprints.performance.PerformanceBlueprint(name, import_name, **kwargs)[source]
Bases:
HawatBlueprint
Pluggable module - system processing performance (performance).
- class hawat.blueprints.performance.RRDDBView[source]
Bases:
FileNameView
View responsible for accessing performance RRD databases.
- authentication = True
Similar to the
decorators
mechanism in Flask pluggable views, you may use this class variable to specify, that the view is protected by authentication. During the process of registering the view into the blueprint inhawat.app.hawatBlueprint.register_view_class()
the view will be automatically decorated withflask_login.login_required()
decorator.The advantage of using this in favor of
decorators
is that the application menu can automatically hide/show items inaccessible to current user.This is a scalar variable that must contain boolean
True
orFalse
.
- classmethod get_directory_path()[source]
Return absolute path to the directory, that will be used as a base path for serving files.
This method does not have any default implementation and must be overridden by a subclass.
- Returns
Absolute path to the directory for serving files.
- Return type
str
- classmethod get_view_name()[source]
Return unique name for the view. Name must be unique in the namespace of parent blueprint/module and should contain only characters
[a-z0-9]
. It will be used for generating endpoint name for the view.This method does not have any default implementation and must be overridden by a subclass.
- Returns
Name for the view.
- Return type
str
- classmethod get_view_title(**kwargs)[source]
Return title for the view, that will be displayed in the
title
tag of HTMLhead
element and also as the content of page header inh2
tag.Default implementation returns the return value of
hawat.view.BaseView.get_menu_title()
method by default.- Parameters
kwargs (dict) – Optional parameters.
- Returns
Title for the view.
- Return type
str
- class hawat.blueprints.performance.ViewView[source]
Bases:
HTMLMixin
,SimpleView
View responsible for presenting system performance in using RRD charts.
- authentication = True
Similar to the
decorators
mechanism in Flask pluggable views, you may use this class variable to specify, that the view is protected by authentication. During the process of registering the view into the blueprint inhawat.app.hawatBlueprint.register_view_class()
the view will be automatically decorated withflask_login.login_required()
decorator.The advantage of using this in favor of
decorators
is that the application menu can automatically hide/show items inaccessible to current user.This is a scalar variable that must contain boolean
True
orFalse
.
- do_before_response(**kwargs)[source]
This method will be called just before generating the response. By providing some meaningfull implementation you can use it for some simple item and response context mangling tasks.
- Parameters
kwargs – Custom additional arguments.
Return menu entry title for the view.
Default implementation returns the return value of
hawat.view.BaseView.get_view_title()
method by default.- Parameters
kwargs (dict) – Optional parameters.
- Returns
Menu entry title for the view.
- Return type
str
- classmethod get_view_icon()[source]
Return menu entry icon name for the view. Given name will be used as index to built-in icon registry.
Default implementation generates the icon name by concatenating the prefix
module-
with module name.- Returns
View icon.
- Return type
str
- classmethod get_view_name()[source]
Return unique name for the view. Name must be unique in the namespace of parent blueprint/module and should contain only characters
[a-z0-9]
. It will be used for generating endpoint name for the view.This method does not have any default implementation and must be overridden by a subclass.
- Returns
Name for the view.
- Return type
str
- classmethod get_view_title(**kwargs)[source]
Return title for the view, that will be displayed in the
title
tag of HTMLhead
element and also as the content of page header inh2
tag.Default implementation returns the return value of
hawat.view.BaseView.get_menu_title()
method by default.- Parameters
kwargs (dict) – Optional parameters.
- Returns
Title for the view.
- Return type
str