批量上传图片进行性能测试

Mass upload pictures for performance testing

要测试许多大型二进制对象的性能,我需要 1.000 个或更多文档附件才能在 Exact Online 中使用。

通过用户界面加载它们非常麻烦:每个文档需要多次点击,而且不容易拖放。电子邮件可能是一种选择,但对于 1.000 个文档来说仍然很麻烦。

如何将大量文档附件快速加载到 Exact Online 中?

最简单的方法是使用网站 lorempixel.com。在每一次独特的点击中,它都会提供一张新的、尺寸可配置的精美图片(吞吐量约为每秒创建 1000 KB 的文档附件)。

set use-http-cache false 

use 868056 /* Set division. */

insert into exactonlinerest..documents
( subject
, type 
)
select 'Sample document #' || value
,      101
from   range(1000)@datadictionary /* Load 1,000 documents. */


insert into exactonlinerest..DocumentAttachmentFiles 
( attachment
, document
, filename
)
/* And each document gets an additional attachment per time this insert is run. Run it 10 times to load 10 document attachments per document. */
select httpget('http://lorempixel.com/400/400/?val=' || value) attachment
,      dct.id
,      value || '.jpg'
from   range(1000, 1)@datadictionary
join   exactonlinerest..documents dct
on     dct.type = 101 
and    dct.subject like 'Sample document #%'
and    dct.subject = 'Sample document #' || value