Skip to content

Commit a7f9d48

Browse files
committed
patch for single char shareflow
1 parent a97f9d3 commit a7f9d48

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

tools/apigee-sackmesser/cmd/export/export.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fi
4141
loginfo "exporting to $export_folder"
4242
mkdir -p "$export_folder"
4343

44-
sackmesser list "organizations/$organization/sharedflows" | jq -r -c '.[]|.'| while read -r sharedflow; do
44+
sackmesser list "organizations/$organization/sharedflows" | jq -r -c '.[]|. | select((. | length) > 1)' | while read -r sharedflow; do
4545
loginfo "download shared flow: $sharedflow"
4646
mkdir -p "$export_folder/sharedflows/$sharedflow"
4747
latest="$(sackmesser list "organizations/$organization/sharedflows/$sharedflow" | jq '.revision | map(tonumber) | max')"

tools/apigee-sackmesser/cmd/report/report.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ performancequery="organizations/$organization/environments/$environment/stats/ap
9393
performancequery+="?limit=14400&offset=0"
9494
performancequery+="&select=sum(message_count)/3600.0,sum(is_error),avg(target_response_time),avg(total_response_time)"
9595
performancequery+="&timeUnit=day"
96-
PERFORMANCE_Q_START=$(date -u -v1d '+%m/%d/%Y%%2000:00:00' 2&>/dev/null || date -u -d "1 day ago" '+%m/%d/%Y%%2000:00:00' || date -u -d "@$(( $(date +%s ) - 86400 ))" '+%m/%d/%Y%%2000:00:00')
96+
PERFORMANCE_Q_START=$(date -u -v1d '+%m/%d/%Y%%2000:00:00' 2&>/dev/null || date -u -d "1 day ago" '+%m/%d/%Y%%2000:00:00' || date -u -d "@$(( $(date +%s ) - 86400 ))" '+%m/%d/%Y%%2000:00:00' || echo '')
9797
performancequery+="&timeRange=$PERFORMANCE_Q_START~$(date -u '+%m/%d/%Y%%2000:00:00')"
9898
sackmesser list "$performancequery" > "$export_folder/performance-$environment.json"
9999

@@ -182,7 +182,6 @@ do
182182

183183
echo "$linkrevision" > "$export_folder/scratch/proxyrevisions/$proxyname"
184184

185-
186185
if [ -d "$proxyexportpath/apiproxy/policies" ];then
187186
policycount=$(find "$proxyexportpath"/apiproxy/policies/*.xml | wc -l)
188187
else
@@ -204,7 +203,7 @@ do
204203
echo "<td>$policycount</td>" >> "$report_html"
205204
echo "<td>$flowcount</td>" >> "$report_html"
206205
echo "</tr>" >> "$report_html"
207-
done < <("$export_folder/apigeelint/proxies/"*.json -print0)
206+
done < <(find "$export_folder/apigeelint/proxies/"*.json -print0)
208207

209208
echo "</tbody></table></div>" >> "$report_html"
210209

@@ -224,7 +223,11 @@ echo "<tbody>" >> "$report_html"
224223
while IFS= read -r -d '' policyusage
225224
do
226225
proxyname=$(basename "${policyusage%%-indexed.*}")
227-
linkrevision=$(cat "$export_folder/scratch/proxyrevisions/$proxyname")
226+
if [ -f "$export_folder/scratch/proxyrevisions/$proxyname" ]; then
227+
linkrevision=$(cat "$export_folder/scratch/proxyrevisions/$proxyname")
228+
else
229+
linkrevision="unknown"
230+
fi
228231
echo "<tr>" >> "$report_html"
229232
echo "<th scope=\"row\"><a href=\"$(resource_link "proxies/$proxyname" "$linkrevision")\" target=\"_blank\">$proxyname</a></th>" >> "$report_html"
230233

0 commit comments

Comments
 (0)