Skip to content

Feature/sc 241416 allow max count tuning #71

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

Open
wants to merge 5 commits into
base: feature/sc-241273-add-interpolation-to-Tranpose-n-Sync
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions custom-recipes/pi-system-retrieve-event-frames/recipe.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@
{
"name": "max_count",
"label": "Max count",
"visibilityCondition": "['RecordedData'].includes(model.data_type)",
"visibilityCondition": "false && model.show_advanced_parameters==true && ['InterpolatedData','PlotData','RecordedData'].includes(model.data_type)",
"description": "",
"type": "INT",
"defaultValue": 1000
"defaultValue": 10000
}
],
"resourceKeys": []
Expand Down
2 changes: 1 addition & 1 deletion custom-recipes/pi-system-retrieve-event-frames/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
batch_buffer_size += 1
if (batch_buffer_size >= batch_size) or (absolute_index == nb_rows_to_process):
rows = client.get_rows_from_webids(
buffer, data_type, max_count,
buffer, data_type, max_count=max_count,
search_full_hierarchy=search_full_hierarchy,
can_raise=False,
batch_size=batch_size,
Expand Down
6 changes: 3 additions & 3 deletions custom-recipes/pi-system-retrieve-list/recipe.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@
{
"name": "max_count",
"label": "Max count",
"visibilityCondition": "false && ['RecordedData'].includes(model.data_type)",
"description": "",
"visibilityCondition": "model.show_advanced_parameters==true && ['InterpolatedData','PlotData','RecordedData'].includes(model.data_type)",
"description": "Larger number speeds data transfer but loads the PI server",
"type": "INT",
"defaultValue": 1000
"defaultValue": 10000
}
],
"resourceKeys": []
Expand Down
4 changes: 2 additions & 2 deletions python-connectors/pi-system_attribute-search/connector.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,10 @@
{
"name": "max_count",
"label": "Max count",
"visibilityCondition": "false && model.must_retrieve_metrics && ['InterpolatedData', 'RecordedData'].includes(model.data_type)",
"visibilityCondition": "model.show_advanced_parameters==true && model.must_retrieve_metrics && ['PlotData', 'InterpolatedData', 'RecordedData'].includes(model.data_type)",
"description": "",
"type": "INT",
"defaultValue": 1000
"defaultValue": 10000
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@
{
"name": "max_count",
"label": "Max count",
"visibilityCondition": "model.must_retrieve_metrics && ['RecordedData'].includes(model.data_type)",
"visibilityCondition": "false && model.show_advanced_parameters==true && model.must_retrieve_metrics && ['PlotData', 'InterpolatedData', 'RecordedData'].includes(model.data_type)",
"description": "",
"type": "INT",
"defaultValue": 1000
"defaultValue": 10000
},
{
"name": "event_frame_to_retrieve",
Expand Down
4 changes: 2 additions & 2 deletions python-connectors/pi-system_piwebapi-toolbox/connector.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@
{
"name": "max_count",
"label": "Max count",
"visibilityCondition": "['RecordedData'].includes(model.data_type)",
"visibilityCondition": "model.show_advanced_parameters==true && ['PlotData', 'InterpolatedData', 'RecordedData'].includes(model.data_type)",
"description": "",
"type": "INT",
"defaultValue": 1000
"defaultValue": 10000
},
{
"type": "SEPARATOR",
Expand Down
7 changes: 5 additions & 2 deletions python-lib/osisoft_plugin_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,14 @@ def get_max_count(config):
# some data_type requests only returns a maximum of 1k items
# This can be increased by using maxCount
DATA_TYPES_REQUIRING_MAXCOUNT = ["InterpolatedData", "PlotData", "RecordedData"]
DEFAULT_MAXCOUNT = 1000
DEFAULT_MAXCOUNT = 10000
max_count = None
data_type = config.get("data_type", None)
if data_type in DATA_TYPES_REQUIRING_MAXCOUNT:
max_count = config.get("max_count", DEFAULT_MAXCOUNT)
if config.get("show_advanced_parameters", False):
max_count = config.get("max_count", DEFAULT_MAXCOUNT)
else:
max_count = DEFAULT_MAXCOUNT
if isinstance(max_count, float):
max_count = int(max_count)
return max_count
Expand Down