Is there any way to have Rmd output be set to both "chunk output inline" and "chunk output in console"?
I like having things inline, but i also like simultaneously having plots go to a zoomed plot window I have on another monitor. Is there any setting that allows both simultaneously?
IE: have both of these settings at the same time:
output:
html_document:
toc: true
toc_float: true
toc_depth: 3
editor_options:
chunk_output_type: inline
and
output:
html_document:
toc: true
toc_float: true
toc_depth: 3
editor_options:
chunk_output_type: console
Related
I am using this code for the first page of my Rmarkdown. I want to add :
name of the course
name of the tutor
number of the words
number of graphs
number of tables
This is my code :
title: "Title of report "
author: "my name"
Email: "my email"
output:
pdf_document:
latex_engine: xelatex
fig_width: 4.5
fig_height: 3
html_document:
df_print: paged
header-includes:
- \usepackage{setspace}
- \onehalfspacing
date: '2022-07-06'
csl: chicago-author-date.csl
bibliography: bib1.bib
Thank you in advance for your help
The goal: Speed up Terminalizer's terminal cast (record)
I have a record of terminal created with Terminalizer. cast.yaml:
# The configurations that used for the recording, feel free to edit them
config:
# do not touch it
# Records, feel free to edit them
records:
- delay: 841
content: "\e]1337;RemoteHost=kyb#kyb-nuc\a\e]1337;CurrentDir=/home/kyb/devel/git-rev-label\a\e]1337;ShellIntegrationVersion=7;shell=fish\a"
- delay: 19
content: "\e]1337;RemoteHost=kyb#kyb-nuc\a\e]1337;CurrentDir=/home/kyb/devel/git-rev-label\a\e]0;fish /home/kyb/devel/git-rev-label\a\e[30m\e(B\e[m"
- delay: 6
content: "\e[?2004h"
- delay: 28
content: "\e]0;fish /home/kyb/devel/git-rev-label\a\e[30m\e(B\e[m\e[2m⏎\e(B\e[m \r⏎ \r\e[K\e]133;D;0\a\e]133;A\a\e[44m\e[30m ~/d/git-rev-label \e[42m\e[34m \e[42m\e[30m demo \e[30m\e(B\e[m\e[32m \e[30m\e(B\e[m\e]133;B\a\e[K"
- delay: 1202
content: "#\b\e[38;2;231;197;71m#\e[30m\e(B\e[m"
- delay: 134
content: "\e[38;2;231;197;71m#\e[30m\e(B\e[m"
- delay: 489
content: "\e[38;2;231;197;71m \e[30m\e(B\e[m"
- delay: 318
I want to speed up payback without passing --speed-factor to terminalizer play. To do so delays should be decreased.
So, I need to create yq-expression to make delays lower
.records.delay=.records.delay/3
but this expression won't work. Please help to write proper one.
.records is an array, so you could use this filter:
.records |= map(.delay /= 3)
Or you might prefer:
.records[].delay |= (. /= 3)
I'm am working on writing some performance tests using Taurus & Jmeter.
After executing a set of tests on a some URLs, I see the stats on console as below.
19:03:40 INFO: Percentiles:
+---------------+---------------+
| Percentile, % | Resp. Time, s |
+---------------+---------------+
| 95.0 | 2.731 |
+---------------+---------------+
19:03:40 INFO: Request label stats:
+--------------+--------+---------+--------+-------+
| label | status | succ | avg_rt | error |
+--------------+--------+---------+--------+-------+
| /v1/brands | OK | 100.00% | 2.730 | |
| /v1/catalogs | OK | 100.00% | 1.522 | |
+--------------+--------+---------+--------+-------+
I'm wondering if there is a way to display other labels per URL. for ex. percentile response time per URL.
Below are all the stats that could be captured from Taurus. (according to taurus documentation), but I couldn't figure out the configuration required to display them onto the console. Appreciate any help.
label - is the sample group for which this CSV line presents the stats. Empty label means total of all labels
concurrency - average number of Virtual Users
throughput - total count of all samples
succ - total count of not-failed samples
fail - total count of saved samples
avg_rt - average response time
stdev_rt - standard deviation of response time
avg_ct - average connect time if present
avg_lt - average latency if present
rc_200 - counts for specific response codes
perc_0.0 .. perc_100.0 - percentile levels for response time, 0 is also minimum response time, 100 is maximum
bytes - total download size
Looking into documentation on Taurus Console Reporter it is possible to amend only the following parameters:
modules:
console:
# disable console reporter
disable: false # default: auto
# configure screen type
screen: console
# valid values are:
# - console (ncurses-based dashboard, default for *nix systems)
# - gui (window-based dashboard, default for Windows, requires Tkinter)
# - dummy (text output into console for non-tty cases)
dummy-cols: 140 # width for dummy screen
dummy-rows: 35 # height for dummy screen
If you can understand and write Python code you can try amending reporting.py file which is responsible for generating stats and summary table. This is a good point to start:
def __report_summary_labels(self, cumulative):
data = [("label", "status", "succ", "avg_rt", "error")]
justify = {0: "left", 1: "center", 2: "right", 3: "right", 4: "left"}
sorted_labels = sorted(cumulative.keys())
for sample_label in sorted_labels:
if sample_label != "":
data.append(self.__get_sample_element(cumulative[sample_label], sample_label))
table = SingleTable(data) if sys.stdout.isatty() else AsciiTable(data)
table.justify_columns = justify
self.log.info("Request label stats:\n%s", table.table)
Otherwise alternatively you can use Online Interactive Reports or configure your JMeter test to use Grafana and InfluxDB as 3rd-party metrics storage and visualisation systems.
This might be quite a long shot, but I've written an AppleScript for myself that keeps log on how long I work for whatever project. I'd like to create another script that calculates the overall spent time based on the info from a log file.
Generally my log files look like this:
140304 1353 - Start
140304 1459 - End
work time : 0106
break time : 0000
140307 1248 - Start
140307 1353 - End
work time : 0105
break time : 0000
140321 1101 - Start
140321 1306 - Have a break now
140321 1342 - Back to work
140321 1423 - Have a break now - Go eat
140321 1522 - Back to work
140321 1522 - End
work time : 0246
break time : 0135
So I would need to get every "work time" value and calculate them together.
I've tried googling around this, but I'm not sure how to get started.
Applescript's Text Item Delimiters (TIDs) are perfect for this. We just break the text up into a list by setting TIDs to the text just before the number you want to grab, in this case "work time". Then I just grab the next word after the TIDs because that's the number. So it's easy. The result of your example is 457. My script returns the sum plus shows all the values used to calculate the sum: {457, {"0106", "0105", "0246"}}
set workLog to "140304 1353 - Start
140304 1459 - End
work time : 0106
break time : 0000
140307 1248 - Start
140307 1353 - End
work time : 0105
break time : 0000
140321 1101 - Start
140321 1306 - Have a break now
140321 1342 - Back to work
140321 1423 - Have a break now - Go eat
140321 1522 - Back to work
140321 1522 - End
work time : 0246
break time : 0135"
set beforeText to "work time"
set AppleScript's text item delimiters to beforeText
set textItems to text items of workLog
set AppleScript's text item delimiters to ""
set theSum to 0
set sumItems to {}
repeat with i from 2 to count of textItems
set workTime to word 1 of (item i of textItems)
set end of sumItems to workTime
set theSum to theSum + (workTime as number)
end repeat
return {theSum, sumItems}
Now just replace the first line in my code with this and it will work for you on your log file. Good luck.
set workLog to read (choose file)
Here's a do shell script-based alternative to #regulus6633's pure AppleScript answer:
Note: I'm not sure what your work-time numbers such as 0106 represent - here I'm simply assuming that they are decimal integers to be summed.
set logFile to "/Users/jdoe/hours.log" # Replace with POSIX path to your log file
set total to do shell script ¬
"awk '/^work time :/ { total+=$4 } END { print total }' " ¬
& quoted form of logFile
The shell command uses awk, which greatly simplifies parsing.
I have a performance problem in a complex watir script. I isolate part of my code, and this is the result :
# Load browser and test page
#browser = Watir::Browser.new :chrome
#browser.goto ("http://myurl")
# Start to inspect time of script
puts "0 - Start : " + Time.new.inspect
# Get active frame
frame = #browser.frame(:id => 'myFrame0123')
puts "1 - Frame is a variable : " + Time.new.inspect
puts frame.exists?
puts "2 - Getting frame src : " + Time.new.inspect
# play
frame.link(:class => "playButton").click # should be fast
puts "3 - Clicking link in frame : " + Time.new.inspect
puts frame.exists? # should be instant
puts "4 - Getting frame src : " + Time.new.inspect
# Closing
#browser.close
The code open a test page, detect a frame, and then click a link in the frame.
Here the result in firefox :
0 - Start : 2013-10-07 15:41:40 +0200
1 - Frame is a variable : 2013-10-07 15:41:40 +0200
true
2 - Getting frame src : 2013-10-07 15:41:40 +0200
3 - Clicking link in frame : 2013-10-07 15:42:01 +0200
true
4 - Getting frame src : 2013-10-07 15:42:54 +0200
The time is lost :
between 2 and 3 : I don't understand how a click on a link in a frame take 20s ?
between 3 and 4 : How a check of existence of a fram could take 50s ?
In chrome, the whole script take less than 10 seconds (As I wish)
Versions : ruby 1.9.3, watir-webdriver 0.6.4, firefox 21, 23, 24.
Finally find why : in the frame I use, there is an image which doesn't exist.
Firefox is slow and wait for the domain to respond, and this is why time is lost.