Skip to content

Instantly share code, notes, and snippets.

View kinow's full-sized avatar
💭
😬

Bruno P. Kinoshita kinow

💭
😬
View GitHub Profile
{"id": "2", "type": "data", "payload": {"data": {"deltas": {"id": "kinow|five", "shutdown": false, "added": {"workflow": {"id": "kinow|five", "__typename": "Workflow", "cyclePoints": [{"id": "kinow|five|5|root", "cyclePoint": "5", "__typename": "FamilyProxy"}, {"id": "kinow|five|4|root", "cyclePoint": "4", "__typename": "FamilyProxy"}, {"id": "kinow|five|1|root", "cyclePoint": "1", "__typename": "FamilyProxy"}, {"id": "kinow|five|6|root", "cyclePoint": "6", "__typename": "FamilyProxy"}], "taskProxies": [{"id": "kinow|five|5|bar", "name": "bar", "state": "waiting", "isHeld": false, "isQueued": true, "cyclePoint": "5", "firstParent": {"id": "kinow|five|5|root", "name": "root", "cyclePoint": "5", "state": "waiting", "__typename": "FamilyProxy"}, "task": {"name": "bar", "__typename": "Task"}, "__typename": "TaskProxy"}, {"id": "kinow|five|4|foo", "name": "foo", "state": "expired", "cyclePoint": "4", "firstParent": {"id": "kinow|five|4|root", "name": "root", "cyclePoint": "4", "state": "expired", "__typename": "Fa
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
Leaving build/test directories:
Work:
/home/kinow/Development/python/miniconda3/envs/test/conda-bld/work
Test:
/home/kinow/Development/python/miniconda3/envs/test/conda-bld/test_tmp
Leaving build/test environments:
@kinow
kinow / query.gql
Created February 17, 2021 21:36
query
subscription OnWorkflowDeltasData($workflowId: ID) {
deltas(workflows: [$workflowId], stripNull: true) {
...WorkflowTreeDeltas
__typename
}
}
fragment WorkflowTreeDeltas on Deltas {
id
shutdown
@kinow
kinow / a-random-delta-five.json
Created January 27, 2021 09:38
a-random-delta-five
{
"id": "2",
"type": "data",
"payload": {
"data": {
"deltas": {
"id": "kinow|five",
"shutdown": false,
"added": {
"workflow": {
@kinow
kinow / suite.rc
Created November 26, 2020 09:09
suite.rc slurm jobs heterogeneos
[scheduling]
initial cycle point = 19831213T0600Z
final cycle point = 19831213T0700Z
[[dependencies]]
[[[R1]]]
graph = "test"
[runtime]
[[test]]
{
"data": {
"workflows": [
{
"id": "kinow|messagetrigger1",
"tasks": [
{
"id": "kinow|messagetrigger1|bar",
"proxies": [
{

When you are working on a project, you normally know what code needs testing. For this example I will show a way to figure out what is missing tests. Just keep in mind that not all of your code needs or can be tested (e.g. in Java OutOfMemoryError or IOException blocks can be tricky to test).

Code Coverage

When running your code with tests, some tools keep track of what portion of the code was actually executed with the tests.

Memory heap allocation

Tested with production mode and development mode, and in both cases the memory appeared to be going up in five, which is not a good sign.

Left it running for 30 minutes whilst I collected the memory heap for analysis in the browser.

33.9% of the memory was in client.onmessage. That's the part of GraphQL Apollo client that receives the messages from the server. 22.14% of the total is in Vuex SET for the GScan workflows data (it appears under client.onmessage due to the tree call, as SET is called after the data is received

@kinow
kinow / airflow-dag.py
Created August 18, 2020 20:54
DAG example workflows
from datetime import datetime
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator
def print_hello():
return 'Hello world!'
# schedule_interval supports CRON syntax
dag = DAG('hello_world', description='Simple tutorial DAG',
@kinow
kinow / performance.md
Last active August 18, 2020 03:14
Performance tests between Cylc UI + deltas, and Cylc UI + deltas + infinite tree

Environment

Thinkpad T530 16GB 8cores. Ubuntu LTS 18.04 up to date. Anaconda Python 3.7.7, with a venv virtual environment activated.

Latest branches of cylc-flow (9d60d6858113322f607b408fb3ead34b3f98a142) and cylc-uiserver (0eba8f3af77ed3adfb10a2f6510b247beaa1fcdc).

Chromium 84. As Cylc UI was built for production mode, VueDevTools doesn't interfere with the performance tests, as it won't be activated either during the tests. I will use only the browser default development tools and lighthouse. Also disabled uBlock origin for localhost.

See file suite.rc for complex workflow source.