Based off https://gist.github.com/millerdev/547bac773483402554797e578fbd238f
export CONTAINER_NAME=open-chat-studio-db-1
export VOLUME_NAME=open-chat-studio_postgres_data
Based off https://gist.github.com/millerdev/547bac773483402554797e578fbd238f
export CONTAINER_NAME=open-chat-studio-db-1
export VOLUME_NAME=open-chat-studio_postgres_data
import uuid | |
from typing import Generic, TypeVar | |
from langchain_core.callbacks import CallbackManagerForChainRun | |
from langchain_core.runnables import RunnableConfig | |
from langchain_core.runnables.base import RunnableSerializable | |
from langchain_core.runnables.utils import ConfigurableField | |
T = TypeVar("T") |
""" | |
Demonstrate a method to create a pipeline that can handle dynamic splits in the pipeline based on the input type. | |
""" | |
import functools | |
import operator | |
from typing import Any | |
from langchain_core.callbacks import CallbackManagerForChainRun | |
from langchain_core.runnables import Runnable, RunnableConfig, RunnableLambda, RunnableSerializable, patch_config | |
from langchain_core.runnables.base import RunnableEach |
{ | |
"resourceType": "CapabilityStatement", | |
"url": "https://www.commcarehq.org/a/<domain>/fhir/capability.json", | |
"name": "CommCare <domain>", | |
"title": "CommCare FHIR capability statement", | |
"status": "draft", | |
"date": "<dateTime>", | |
"publisher": "Dimagi", | |
"kind": "capability", | |
"implementation": { |
import os | |
import csv | |
import shutil | |
import gzip | |
from datetime import datetime, timedelta | |
from collections import Counter | |
from elasticsearch.exceptions import ConnectionTimeout | |
from corehq.util.timezones.utils import parse_date | |
from corehq.apps.es import FormES |
import csv | |
import shutil | |
import gzip | |
from collections import Counter | |
from elasticsearch.exceptions import ConnectionTimeout | |
from corehq.util.timezones.utils import parse_date | |
path = '/home/cchq/form_dates' | |
try: |
## | |
# {{ ansible_managed }} | |
# See https://github.com/dimagi/commcare-cloud/compare/sk/logstash?expand=1 | |
filter { | |
if [type] == "nginx-timing" { | |
grok { | |
match => [ | |
"message", "\[%{HTTPDATE:http_timestamp}\] (?<cache_status>[-\w]+) %{WORD:http_method} %{DATA:request} HTTP/%{NUMBER:httpversion} %{NUMBER:status_code} %{NUMBER:request_time}" | |
] |
@module mod-python | |
@define logpath "/home/cchq/www/{{ deploy_env }}/logs" | |
@define environment "{{ env_monitoring_id }}" | |
@define statsd_host "{{ datadog_statsd_host|default('localhost') }}" | |
@define statsd_port "{{ datadog_statsd_port|default(8125) }}" | |
source src { | |
file("`logpath`/{{ deploy_env }}-timing.log" follow-freq(1) flags(no-parse)); | |
}; |
# Load and parse CSV logs from PostgreSQL | |
import os | |
import re | |
import sys | |
import postgres_copy | |
import six | |
import sqlalchemy |
cat icds_cas_commcare-nginx_access.log | cut -d' ' -f 10,14 > cas_logs.txt | |
cat icds_cas_commcare-nginx_access.log.1 | cut -d' ' -f 10,14 >> cas_logs.txt | |
cat icds_commcare-nginx_access.log | cut -d' ' -f 10,14 >> cas_logs.txt | |
zcat icds_cas_commcare-nginx_access.log.*.gz | cut -d' ' -f 10,14 >> cas_logs.txt | |
echo -n 'Total,'; echo awk '{s+=$2}END{print s}' cas_logs.txt | |
echo -n 'App audio downloads,'; cat cas_logs.txt | grep CommCareAudio | awk '{s+=$2}END{print s}' | |
echo -n 'App video downloads,'; cat cas_logs.txt | grep CommCareVideo | awk '{s+=$2}END{print s}' | |
echo -n 'App image downloads,'; cat cas_logs.txt | grep CommCareImage | awk '{s+=$2}END{print s}' | |
echo -n 'Static files,'; cat cas_logs.txt | grep static | awk '{s+=$2}END{print s}' |