Skip to content

Commit

Permalink
Ionosphere - matches page
Browse files Browse the repository at this point in the history
IssueID #1996: Ionosphere - matches page
- Create the ionosphere_summary_memcache_object - skyline/ionoosphere/ionosphere.py
- Lint - skyline/skyline_functions.py
- Added to skyline/webapp/ionosphere_backend.py get_fp_matches and
  get_matched_id_resources.
  Added get_fp_matches, get_matched_id_resources, fp_search_or_matches_req and
  fp_matches.  Handle both fp_search and fp_matches.
  Added 'matched_fp_id', 'matched_layer_id' request arguments.
  Added matched_graph_image_file to show the graph for the matched event in the
  features_profile MATCHED Evaluation page.
- Added the Matches Ionosphere page and menu tabs

IssueID #2166: panorama incorrect mysql_id cache keys
- Wrap in except around mysql_select

IssueID #2158: webapp - redis metric check - existing but sparsely represented metrics
- If this is an fp_view=true, it means that either the metric is sparsely
  represented or no longer exists, but an fp exists so continue and do not 404

- Note about unused TSFRESH_VERSION in skyline/features_profile.py

Added:
skyline/webapp/templates/features_profiles_matches.html

Modified:
skyline/features_profile.py
skyline/ionosphere/ionosphere.py
skyline/panorama/panorama.py
skyline/skyline_functions.py
skyline/webapp/backend.py
skyline/webapp/ionosphere_backend.py
skyline/webapp/templates/features_profiles.html
skyline/webapp/templates/ionosphere.html
skyline/webapp/templates/search_features_profiles.html
skyline/webapp/webapp.py
  • Loading branch information
earthgecko committed Sep 19, 2017
1 parent 3381ed6 commit fb125e5
Show file tree
Hide file tree
Showing 9 changed files with 829 additions and 19 deletions.
14 changes: 8 additions & 6 deletions skyline/features_profile.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import logging
import os
import sys
import datetime
import csv
# import sys
# import datetime
# import csv
import time
from ast import literal_eval

import traceback
import json
# import json
from timeit import default_timer as timer
import numpy as np
# import numpy as np
import pandas as pd

from tsfresh.feature_extraction import (
Expand All @@ -19,6 +19,8 @@
import settings
import skyline_version
from skyline_functions import write_data_to_file
# TSFRESH_VERSION below was only added to a single log output as it was unused
# however it may be used in one of the tests in some way, I shall have to search
from tsfresh_feature_names import TSFRESH_FEATURES, TSFRESH_VERSION

skyline_version = skyline_version.__absolute_version__
Expand Down Expand Up @@ -251,7 +253,7 @@ def calculate_features_profile(current_skyline_app, timestamp, metric, context):
df.columns = ['metric', 'timestamp', 'value']

start_feature_extraction = timer()
current_logger.info('starting extract_features')
current_logger.info('starting extract_features with %s' % str(TSFRESH_VERSION))
try:
# @modified 20161226 - Bug #1822: tsfresh extract_features process stalling
# Changed to use the new ReasonableFeatureExtractionSettings that was
Expand Down
9 changes: 9 additions & 0 deletions skyline/ionosphere/ionosphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -2102,6 +2102,15 @@ def run(self):
settings.IONOSPHERE_LEARN_FOLDER,
settings.IONOSPHERE_KEEP_TRAINING_TIMESERIES_FOR)

# @added 20170916 - Feature #1996: Ionosphere - matches page
# Create the ionosphere_summary_memcache_object
if settings.MEMCACHE_ENABLED:
try:
logger.info('updating the ionosphere_summary_memcache_object')
self.update_ionosphere_summary_memcache_object
except:
logger.error('error :: update_ionosphere_summary_memcache_object - %s' % traceback.print_exc())

# self.populate the database metatdata tables
# What is my host id in the Skyline panorama DB?
host_id = False
Expand Down
6 changes: 2 additions & 4 deletions skyline/skyline_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1148,10 +1148,9 @@ def in_list(metric_name, check_list):

return False


# @added 20170825 - Task #2132: Optimise Ionosphere DB usage
# Get the metric db object data to memcache


def get_memcache_metric_object(current_skyline_app, base_name):
"""
Return the metrics_db_object from memcache if it exists.
Expand Down Expand Up @@ -1219,10 +1218,9 @@ def get_memcache_metric_object(current_skyline_app, base_name):

return False


# @added 20170826 - Task #2132: Optimise Ionosphere DB usage
# Get the fp_ids list object data to memcache


def get_memcache_fp_ids_object(current_skyline_app, base_name):
"""
Return the fp_ids list from memcache if it exists.
Expand Down
2 changes: 1 addition & 1 deletion skyline/webapp/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def get_ids_from_rows(thing, rows):
if from_timestamp and from_timestamp != 'all':

if ":" in from_timestamp:
# import time
import time
import datetime
new_from_timestamp = time.mktime(datetime.datetime.strptime(from_timestamp, '%Y%m%d %H:%M').timetuple())
from_timestamp = str(int(new_from_timestamp))
Expand Down

0 comments on commit fb125e5

Please sign in to comment.