Sample script for calling a stored procedure with loadrunner? - stored-procedures

Im very new to loadrunner. I couldnt find any online material on running stored procs (for mssql) for loadrunner script. it says it need to be ansi c. I even wrote a c# that connects to db and call the stored proc in question and then used it for "recording" the task. after running it, it didnt generate the script i was hoping for. is that how it suppose to work? i doubt it :P help. pls point me to a good site or sample script pls. Thanks!

Use the lrd_* functions for ODBC. In this case you'll need lrd_stmt to write your SQL statement followed by lrd_exec to execute it.
I can't give an example as I don't have an application to record to hand, but the function reference should give you the information you need.

Related

Solana Anchor with Ruby On Rails

Have the next problem, I use the Anchor to build and deploy the program on Solana blockchain and now I met with the problem of how to interact with this program using ruby in rails, as I understand it, first we have to use binary encoding to send a transaction, and if we want to get data, use the same decoding, maybe someone has some examples of how the encoding should be done correctly? as I understand it, we encode the ID of the program, the last hash of the block, the name of the function and the data to create a transaction. Maybe someone has done this using ruby and has an example? sincerely grateful!
It's going to be really annoying to do in Ruby. You have to use the Solana API/RPC to build and send the transaction, including encoding the data for accounts using Borsh (or whatever, but most use Borsh) etc.
I'd use JS/TS to do all of the interacting with your program unless you have a very good reason to do otherwise and a lot of time and energy on your hands. TS already has this stuff in web3.js / Anchor.

Binaries result comparisons

I'm a young maths teacher and I'm introducing algorithms to my students.
They learn C basics to write their programs.
I have more 400 students and testing their programs takes me a lot of time.
Already wrote a shell script but they need to send me the binary.
So I would like to set up a platform where they can upload their binaries or their sources and test it.
The school gave me a Jenkins and a web instance.
I did read some docs about Jenkins and JUnit but I don't see how can I test output of another program.
Thanks for your answers.
You don't have to use Jenkins and JUnit necessarily. You don't need anything else than your own laptop and a bash script. They are just doing C programming...
First, gather your students code in an organized manner (send code by mail or download them from the platform). Then, prepare some input and output files (which correct results obviously) and write a tiny script which will execute your students code with these prepared inputs. The script will finally compare the results with your prepared outputs.
Some notes to make things easier because students always do things their own way:
be precise on how they have to compile their program (flags, given makefile...)
be clear on the input and output format
I tell them to give their program in a specific way (name of program with NAME or ID)
If they don't follow my guidelines they get minus points. This is so much important because they have to learn to be rigorous and in the same time you also gain tremendous time. They have to put the effort to make your correction process efficient especially when you have so much students.
But well you can also dig in Jenkins doc it might be worth it (although I do not use it personnally). And why can't you ask your school to help you for that ?
Edit: Maybe this CMake/C++ Jenkins topic might be help you.

Ruby on Rails - How to manage multiple access to shared file

I am quite new to Rails and I need to implement a project for my University. This project consists of a website that will use a binary file as database.
So I need to know a thread safe way to read and write this file, taking into consideration that the same file (database) will be used by multiple process (each time someone access the site, it should read and write data into the file).
Thanks in advance
There really isn't a graceful way to handle that. You're much better off taking a more traditional approach, with a SQL server like mySQL or PostgreSQL, which do basically that same thing.
Edit:
I didn't realize you could use sqlite in multi-threaded mode. That would seem to satisfy both requirements...

Serializing a TdwsProgram

As I understand it, DWScript does not compile scripts into an intermediary bytecode. However, I would like to be able to store a "compiled" script, to be able to send it through a stream or save it to a file.
I was wondering: Is there a way to serialize a TdwsProgram object?
I didn't manage to find any answer anywhere. I have looked over the code and it doesn't seem to be possible, but I thought I should ask the question anyway...
As far as I remember, it is not implemented nor wanted by its actual maintainer (since the execution AST is a tree of objects).
See this reference article about Why no bytecode format.
The easiest would be to first stream the source code, then compile it again.
DWS compilation is very fast, faster than Delphi, and Eric tries to always improve it, even if new features are added.

Is there a set of complete documentation for mysql-proxy lua scripting?

I am playing with scripting for mysql-proxy. What I am trying to accomplish is irrelevant. What I am finding, however, is that there appears to be elements of the lua interface that are undocumented. The big "smoking gun" I have is the disconnect_client() hook. I cannot find it documented anywhere in the official documentation, though it's used in an example on the explanation of the admin interface. It's also used extensively in the example docs. A quick grep shows its use in the following scripts included in the 5.5.8 distribution:
active-queries.lua
active-transactions.lua
load-multi.lua
ro-pooling.lua
rw-splitting.lua
tutorial-keepalive.lua
My other example that has caught my eye is the list of attributes for entries in the proxy.global.backends table. The documentation lists the following attributes:
dst.name
dst.address
dst.port
connected_clients
state
type
However, several of the example scripts reference a fairly complex element called pool. Take for instance tutorial-keepalive.lua:
local s = proxy.global.backends[i]
local pool = s.pool
local cur_idle = pool.users[proxy.connection.client.username].cur_idle_connections
At first I thought it was being added somewhere else in the lua, but I've looked and I can't find any code assigning into proxy.global.backends[i].pool.
So, two questions I suppose:
Am I nuts? Please feel free to demonstrate how I've overlooked the obvious and the documentation is really quite clear.
Assuming I am correct, is there anywhere to find the complete documentation? A nice link would be great (though I couldn't google one up), but even "take a look at this .c file from the mysql-proxy distro that defines the interface". At least that would give me something to poke at.
Thanks
Just opened Proxy/Lua myself. I'm afraid, as with all things Mysql, once you dip under the covers you are on your own. The same goes for LUA.
You will need other addons to LUA to do what you want to do, I would like to suggest:
http://peterodding.com/code/lua/apr/docs/#shared_memory
for the Apache Protable library binding... saved me a shedload of time.
As for the internals of MySql, you will probably need to look in teh C source files, sadly, as we are in unexplored territory here.
One thing I have found is that the LUA structures in Mysql are not Lua tables, but Lua 'user data'. This means that they are effectively shared memory, so are not changeable by Lua, as Mysql uses them too. I am going to try the luaposix library to see if I can get inbto them, as there are elements I would like to change, if possible.
Good luck
peter.colclough#toolstation.com

Resources