Skip to content

Commit

Permalink
Merge pull request #94 from wri/feature/lambda-profiler
Browse files Browse the repository at this point in the history
remove xray and add code guru profiling
  • Loading branch information
solomon-negusse authored Aug 23, 2024
2 parents 793d614 + e1f8f25 commit 8034fe0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
6 changes: 2 additions & 4 deletions lambdas/fanout/src/lambda_function.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from copy import deepcopy

from aws_xray_sdk.core import patch, xray_recorder
from codeguru_profiler_agent import with_lambda_profiler

from raster_analysis.boto import invoke_lambda, lambda_client
from raster_analysis.globals import LOGGER, RASTER_ANALYSIS_LAMBDA_NAME

patch(["boto3"])


@xray_recorder.capture("Fanout Raster Analysis")
@with_lambda_profiler(profiling_group_name="raster_analysis_fanout_profiler")
def handler(event, context):
tiles = event.get("tiles", [])
payload_base = event["payload"]
Expand Down
6 changes: 2 additions & 4 deletions lambdas/raster_analysis/src/lambda_function.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from aws_xray_sdk.core import patch, xray_recorder
from codeguru_profiler_agent import with_lambda_profiler
from pandas import DataFrame

from raster_analysis.data_cube import DataCube
Expand All @@ -9,10 +9,8 @@
from raster_analysis.query_executor import QueryExecutor
from raster_analysis.results_store import AnalysisResultsStore, ResultStatus

patch(["boto3"])


@xray_recorder.capture("Raster Analysis")
@with_lambda_profiler(profiling_group_name="raster_analysis_default_profiler")
def handler(event, context):
try:
LOGGER.info(f"Running analysis with parameters: {event}")
Expand Down
6 changes: 2 additions & 4 deletions lambdas/tiled_analysis/src/lambda_function.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from aws_xray_sdk.core import patch, xray_recorder
from codeguru_profiler_agent import with_lambda_profiler

from raster_analysis.data_environment import DataEnvironment
from raster_analysis.exceptions import QueryParseException
from raster_analysis.globals import LOGGER
from raster_analysis.tiling import AnalysisTiler

patch(["boto3"])


@xray_recorder.capture("Tiled Analysis")
@with_lambda_profiler(profiling_group_name="raster_analysis_tiled_profiler")
def handler(event, context):
try:
LOGGER.info(f"Running analysis with parameters: {event}")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
author="Justin Terry/Thomas Maschler",
license="MIT",
install_requires=[
"aws-xray-sdk==2.12.0",
"requests==2.31.0",
"geobuf==1.1.1",
"protobuf==3.20.3",
"pydantic==1.10.12",
"mo_sql_parsing==9.436.23241",
"codeguru-profiler-agent",
],
)

0 comments on commit 8034fe0

Please sign in to comment.